restrict min level constraints for forum topics to mod+admin and restrict options based on current user's level. check privileges for visiblity in forum posts and topics. deprecate serializable_hash (undocumented, internal) for as_json, refactor to use hidden_attributes and method_attributes #2658
This commit is contained in:
@@ -1472,25 +1472,11 @@ class Post < ActiveRecord::Base
|
||||
[ :pixiv_ugoira_frame_data ]
|
||||
end
|
||||
|
||||
def serializable_hash(options = {})
|
||||
def as_json(options = {})
|
||||
options ||= {}
|
||||
options[:include] ||= []
|
||||
options[:include] += associated_attributes
|
||||
options[:except] ||= []
|
||||
options[:except] += hidden_attributes
|
||||
unless options[:builder]
|
||||
options[:methods] ||= []
|
||||
options[:methods] += method_attributes
|
||||
end
|
||||
hash = super(options)
|
||||
hash
|
||||
end
|
||||
|
||||
def to_xml(options = {}, &block)
|
||||
options ||= {}
|
||||
options[:methods] ||= []
|
||||
options[:methods] += method_attributes
|
||||
super(options, &block)
|
||||
super(options)
|
||||
end
|
||||
|
||||
def to_legacy_json
|
||||
|
||||
Reference in New Issue
Block a user