All animals are equal, but some animals are more equal than others

This commit is contained in:
redfast00 2019-09-06 23:31:46 +02:00
parent 2069ea91db
commit 85b6cc7d7b
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C

View file

@ -49,7 +49,7 @@ class User < ActiveRecord::Base
.pluck(:created_at) .pluck(:created_at)
frequency = (last_datetimes.map(&:to_time).map(&:to_i).sum / (num_orders * 10)) frequency = (last_datetimes.map(&:to_time).map(&:to_i).sum / (num_orders * 10))
bonus = self.rich_privilege / 1.936 bonus = self.rich_privilege / 1.936
self.frecency = frequency * bonus self.frecency = (frequency * bonus * (self.admin ? 1.01 : 1)).to_i
self.save self.save
end end