fixes #2640: Change some API representations
This commit is contained in:
@@ -77,7 +77,21 @@ class PostFlag < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
module ApiMethods
|
||||
def hidden_attributes
|
||||
super + [:creator_id]
|
||||
end
|
||||
|
||||
def serializable_hash(options = {})
|
||||
options ||= {}
|
||||
options[:except] ||= []
|
||||
options[:except] += hidden_attributes
|
||||
super(options)
|
||||
end
|
||||
end
|
||||
|
||||
extend SearchMethods
|
||||
include ApiMethods
|
||||
|
||||
def update_post
|
||||
post.update_column(:is_flagged, true) unless post.is_flagged?
|
||||
|
||||
Reference in New Issue
Block a user