add more deterministic ordering for post versions

This commit is contained in:
Albert Yi
2018-05-25 10:42:36 -07:00
parent 63ab637419
commit 6ad774b939

View File

@@ -85,7 +85,7 @@ class Post < ApplicationRecord
end
if PostArchive.enabled?
has_many :versions, -> {order("post_versions.updated_at ASC")}, :class_name => "PostArchive", :dependent => :destroy
has_many :versions, -> { Rails.env.test? ? order("post_versions.updated_at ASC, post_versions.id ASC") : order("post_versions.updated_at ASC") }, :class_name => "PostArchive", :dependent => :destroy
end
module FileMethods