FIX ALLES OOIT
This commit is contained in:
parent
c88dcf2b12
commit
019301e819
1 changed files with 1 additions and 0 deletions
|
@ -44,6 +44,7 @@ class User < ActiveRecord::Base
|
|||
num_orders = Rails.application.config.frecency_num_orders
|
||||
last_datetimes = self.orders.order(created_at: :desc)
|
||||
.limit(num_orders)
|
||||
.distinct
|
||||
.pluck(:created_at)
|
||||
self.frecency = last_datetimes.map(&:to_time).map(&:to_i).sum / (num_orders * 10)
|
||||
self.save
|
||||
|
|
Loading…
Reference in a new issue