Merge branch 'master' of github.com:r888888888/danbooru

This commit is contained in:
r888888888
2013-05-20 16:28:29 -07:00
64 changed files with 271 additions and 101 deletions

View File

@@ -519,7 +519,7 @@ class User < ActiveRecord::Base
options[:except] ||= []
options[:except] += hidden_attributes
options[:methods] ||= []
options[:methods] += [:wiki_page_version_count, :artist_version_count, :pool_version_count, :forum_post_count, :comment_count]
options[:methods] += [:wiki_page_version_count, :artist_version_count, :pool_version_count, :forum_post_count, :comment_count, :positive_feedback_count, :neutral_feedback_count, :negative_feedback_count]
super(options)
end
@@ -529,7 +529,7 @@ class User < ActiveRecord::Base
options[:except] ||= []
options[:except] += hidden_attributes
options[:methods] ||= []
options[:methods] += [:wiki_page_version_count, :artist_version_count, :pool_version_count, :forum_post_count, :comment_count]
options[:methods] += [:wiki_page_version_count, :artist_version_count, :pool_version_count, :forum_post_count, :comment_count, :positive_feedback_count, :neutral_feedback_count, :negative_feedback_count]
super(options, &block)
end
@@ -563,6 +563,18 @@ class User < ActiveRecord::Base
def comment_count
Comment.for_creator(id).count
end
def positive_feedback_count
feedback.positive.count
end
def neutral_feedback_count
feedback.neutral.count
end
def negative_feedback_count
feedback.negative.count
end
end
module SearchMethods