fix chaining of hidden_attributes/method_attributes
This commit is contained in:
@@ -104,7 +104,7 @@ class ForumPost < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def hidden_attributes
|
def hidden_attributes
|
||||||
[:text_index]
|
super + [:text_index]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class ForumTopic < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def hidden_attributes
|
def hidden_attributes
|
||||||
[:text_index, :min_level]
|
super + [:text_index, :min_level]
|
||||||
end
|
end
|
||||||
|
|
||||||
def merge(topic)
|
def merge(topic)
|
||||||
|
|||||||
@@ -1469,7 +1469,7 @@ class Post < ActiveRecord::Base
|
|||||||
|
|
||||||
module ApiMethods
|
module ApiMethods
|
||||||
def hidden_attributes
|
def hidden_attributes
|
||||||
list = [:tag_index]
|
list = super + [:tag_index]
|
||||||
if !visible?
|
if !visible?
|
||||||
list += [:md5, :file_ext]
|
list += [:md5, :file_ext]
|
||||||
end
|
end
|
||||||
@@ -1477,7 +1477,7 @@ class Post < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def method_attributes
|
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?
|
if visible?
|
||||||
list += [:file_url, :large_file_url, :preview_file_url]
|
list += [:file_url, :large_file_url, :preview_file_url]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class PostFlag < ActiveRecord::Base
|
|||||||
|
|
||||||
module ApiMethods
|
module ApiMethods
|
||||||
def hidden_attributes
|
def hidden_attributes
|
||||||
list = []
|
list = super
|
||||||
unless CurrentUser.is_moderator?
|
unless CurrentUser.is_moderator?
|
||||||
list += [:creator_id]
|
list += [:creator_id]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user