performance tweaks for rails 4.1

This commit is contained in:
r888888888
2014-04-24 22:18:14 -07:00
parent a89c57cee0
commit aab03422bc
16 changed files with 22 additions and 16 deletions

View File

@@ -66,7 +66,7 @@ class PostVersion < ActiveRecord::Base
end
def sequence_for_post
versions = PostVersion.where(:post_id => post_id).order("updated_at desc, id desc").all
versions = PostVersion.where(:post_id => post_id).order("updated_at desc, id desc")
diffs = []
versions.each_index do |i|
if i < versions.size - 1