Created
May 29, 2014 23:03
-
-
Save chrishomer/fdb32e0bc3498aef7aca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To try and fix the sort order, switching to an integer instead of time. | |
integer :listed_at do |item| | |
original_listed_at_time = nil | |
original_item = item.original_item if item.original_item_id.present? && item.payout_policy == "upfront" | |
if original_item && original_item.created_at < Time.parse("April 1 2014") | |
original_listed_at_time = original_item.listed_at | |
end | |
(original_listed_at_time || item.sorting_from || item.listed_at || item.created_at).to_i | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment