diff --git a/app/models/artist.rb b/app/models/artist.rb index d25dce4d6..766b3534e 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -306,6 +306,24 @@ class Artist < ActiveRecord::Base end end + module ApiMethods + def hidden_attributes + super + [:other_names_index] + end + + def legacy_api_hash + return { + :id => id, + :name => name, + :other_names => other_names, + :group_name => group_name, + :urls => artist_urls.map {|x| x.url}, + :is_active => is_active?, + :updater_id => 0 + } + end + end + include UrlMethods include NameMethods include GroupMethods @@ -315,6 +333,7 @@ class Artist < ActiveRecord::Base include TagMethods include BanMethods extend SearchMethods + include ApiMethods def status if is_banned? && is_active? @@ -328,18 +347,6 @@ class Artist < ActiveRecord::Base end end - def legacy_api_hash - return { - :id => id, - :name => name, - :other_names => other_names, - :group_name => group_name, - :urls => artist_urls.map {|x| x.url}, - :is_active => is_active?, - :updater_id => 0 - } - end - def initialize_creator self.creator_id = CurrentUser.user.id end diff --git a/app/models/comment.rb b/app/models/comment.rb index a2973cf22..40a04c32e 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -140,6 +140,10 @@ class Comment < ActiveRecord::Base def editable_by?(user) creator_id == user.id || user.is_janitor? end + + def hidden_attributes + super + [:body_index] + end end Comment.connection.extend(PostgresExtensions) diff --git a/app/models/dmail.rb b/app/models/dmail.rb index e79597bf4..dc7c6a065 100644 --- a/app/models/dmail.rb +++ b/app/models/dmail.rb @@ -188,4 +188,8 @@ class Dmail < ActiveRecord::Base def visible_to?(user) user.is_moderator? || owner_id == user.id end + + def hidden_attributes + super + [:message_index] + end end diff --git a/app/models/forum_post.rb b/app/models/forum_post.rb index db1efde41..9e2c308d4 100644 --- a/app/models/forum_post.rb +++ b/app/models/forum_post.rb @@ -161,4 +161,8 @@ class ForumPost < ActiveRecord::Base x.body = x.quoted_response end end + + def hidden_attributes + super + [:text_index] + end end diff --git a/app/models/forum_topic.rb b/app/models/forum_topic.rb index e018552a9..b73a6a4a0 100644 --- a/app/models/forum_topic.rb +++ b/app/models/forum_topic.rb @@ -96,4 +96,8 @@ class ForumTopic < ActiveRecord::Base def presenter(forum_posts) @presenter ||= ForumTopicPresenter.new(self, forum_posts) end + + def hidden_attributes + super + [:text_index] + end end diff --git a/app/models/note.rb b/app/models/note.rb index 3ca9c5347..2f0dc537a 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -61,6 +61,10 @@ class Note < ActiveRecord::Base end module ApiMethods + def hidden_attributes + super + [:body_index] + end + def serializable_hash(options = {}) options ||= {} options[:except] ||= [] diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 1c0371036..e997e17ca 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -58,6 +58,10 @@ class WikiPage < ActiveRecord::Base end module ApiMethods + def hidden_attributes + super + [:body_index] + end + def serializable_hash(options = {}) options ||= {} options[:except] ||= []