Skip to content

Commit

Permalink
Use Version#timestamp_sort_order for ordering of versions on Cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
batter committed Jan 20, 2016
1 parent cfcd11d commit c200721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paper_trail/cleaner.rb
Expand Up @@ -38,7 +38,7 @@ def gather_versions(item_id = nil, date = :all)
raise ArgumentError.new("`date` argument must receive a Timestamp or `:all`")
end
versions = item_id ? PaperTrail::Version.where(:item_id => item_id) : PaperTrail::Version
versions = versions.order(PaperTrail.timestamp_field, :id)
versions = versions.order(PaperTrail::Version.timestamp_sort_order)
versions = versions.between(date.to_date, date.to_date + 1.day) unless date == :all

# If `versions` has not been converted to an ActiveRecord::Relation yet,
Expand Down

0 comments on commit c200721

Please sign in to comment.