diff --git a/app/models/post_version.rb b/app/models/post_version.rb index 27f8cb4e5..bb218d4d1 100644 --- a/app/models/post_version.rb +++ b/app/models/post_version.rb @@ -94,7 +94,7 @@ class PostVersion < ActiveRecord::Base end def previous - PostVersion.where("post_id = ? and id < ?", post_id, id).order("updated_at desc").first + PostVersion.where("post_id = ? and updated_at < ?", post_id, updated_at).order("updated_at desc").first end def truncated_source