fix chaining of hidden_attributes/method_attributes
This commit is contained in:
@@ -104,7 +104,7 @@ class ForumPost < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def hidden_attributes
|
||||
[:text_index]
|
||||
super + [:text_index]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -79,7 +79,7 @@ class PostFlag < ActiveRecord::Base
|
||||
|
||||
module ApiMethods
|
||||
def hidden_attributes
|
||||
list = []
|
||||
list = super
|
||||
unless CurrentUser.is_moderator?
|
||||
list += [:creator_id]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user