fix chaining of hidden_attributes/method_attributes

This commit is contained in:
Albert Yi
2016-10-27 14:53:25 -07:00
parent 8d0781c27f
commit 60eebd9608
4 changed files with 5 additions and 5 deletions

View File

@@ -104,7 +104,7 @@ class ForumPost < ActiveRecord::Base
end
def hidden_attributes
[:text_index]
super + [:text_index]
end
end

View File

@@ -178,7 +178,7 @@ class ForumTopic < ActiveRecord::Base
end
def hidden_attributes
[:text_index, :min_level]
super + [:text_index, :min_level]
end
def merge(topic)

View File

@@ -1469,7 +1469,7 @@ class Post < ActiveRecord::Base
module ApiMethods
def hidden_attributes
list = [:tag_index]
list = super + [:tag_index]
if !visible?
list += [:md5, :file_ext]
end
@@ -1477,7 +1477,7 @@ class Post < ActiveRecord::Base
end
def method_attributes
list = [:uploader_name, :has_large, :tag_string_artist, :tag_string_character, :tag_string_copyright, :tag_string_general, :has_visible_children]
list = super + [:uploader_name, :has_large, :tag_string_artist, :tag_string_character, :tag_string_copyright, :tag_string_general, :has_visible_children]
if visible?
list += [:file_url, :large_file_url, :preview_file_url]
end

View File

@@ -79,7 +79,7 @@ class PostFlag < ActiveRecord::Base
module ApiMethods
def hidden_attributes
list = []
list = super
unless CurrentUser.is_moderator?
list += [:creator_id]
end