changed about you, changed price settings
This commit is contained in:
@@ -15,7 +15,7 @@ class Item < ActiveRecord::Base
|
||||
end
|
||||
|
||||
# TODO: change "best selling" algorithm when get some data - currently it's only sorted by earnings
|
||||
scope :best_selling, -> (offset, limit) { where(:on_display => true).order("(list_price - current_input_price) DESC").limit(limit).offset(offset) }
|
||||
scope :best_selling, -> (offset, limit) { where(:on_display => true).order("list_price ASC").limit(limit).offset(offset) }
|
||||
|
||||
scope :best_selling_in_sub_category, -> (sub_category_id, offset, limit) { best_selling(offset, limit).where(sub_category_id: sub_category_id) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user