From 85b6cc7d7b0002e2ae7b8c29461da3be2883fbf7 Mon Sep 17 00:00:00 2001 From: redfast00 Date: Fri, 6 Sep 2019 23:31:46 +0200 Subject: [PATCH] All animals are equal, but some animals are more equal than others --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 7f9395b..9966acc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -49,7 +49,7 @@ class User < ActiveRecord::Base .pluck(:created_at) frequency = (last_datetimes.map(&:to_time).map(&:to_i).sum / (num_orders * 10)) bonus = self.rich_privilege / 1.936 - self.frecency = frequency * bonus + self.frecency = (frequency * bonus * (self.admin ? 1.01 : 1)).to_i self.save end