performance tweaks for rails 4.1
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -607,7 +607,7 @@ class Tag < ActiveRecord::Base
|
||||
search_for = "%" + query.to_escaped_for_sql_like + "%"
|
||||
end
|
||||
|
||||
Tag.where(["name LIKE ? ESCAPE E'\\\\' AND post_count > 0 AND name <> ?", search_for, query]).all(:order => "post_count DESC", :limit => 6, :select => "name").map(&:name).sort
|
||||
Tag.where(["name LIKE ? ESCAPE E'\\\\' AND post_count > 0 AND name <> ?", search_for, query]).order("post_count DESC").limit(6).select("name").map(&:name).sort
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class TagImplication < ActiveRecord::Base
|
||||
|
||||
until children.empty?
|
||||
all.concat(children)
|
||||
children = TagImplication.where("antecedent_name IN (?) and status in (?)", children, ["active", "processing"]).all.map(&:consequent_name)
|
||||
children = TagImplication.where("antecedent_name IN (?) and status in (?)", children, ["active", "processing"]).map(&:consequent_name)
|
||||
end
|
||||
end.sort.uniq
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@ class UserNameChangeRequest < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def feedback
|
||||
UserFeedback.for_user(user_id).order("id desc").all
|
||||
UserFeedback.for_user(user_id).order("id desc")
|
||||
end
|
||||
|
||||
def notify_admins
|
||||
|
||||
Reference in New Issue
Block a user