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:
@@ -360,34 +360,14 @@ class Pool < ActiveRecord::Base
|
||||
clear_post_id_array
|
||||
end
|
||||
|
||||
def to_xml(options = {}, &block)
|
||||
# to_xml ignores the serializable_hash method
|
||||
options ||= {}
|
||||
options[:methods] = [:creator_name]
|
||||
super(options, &block)
|
||||
def method_attributes
|
||||
super + [:creator_name]
|
||||
end
|
||||
|
||||
def strip_name
|
||||
self.name = name.to_s.strip
|
||||
end
|
||||
|
||||
def serializable_hash(options = {})
|
||||
return {
|
||||
"category" => category,
|
||||
"created_at" => created_at,
|
||||
"creator_id" => creator_id,
|
||||
"creator_name" => creator_name,
|
||||
"description" => description,
|
||||
"id" => id,
|
||||
"is_active" => is_active?,
|
||||
"is_deleted" => is_deleted?,
|
||||
"name" => name,
|
||||
"post_count" => post_count,
|
||||
"post_ids" => post_ids,
|
||||
"updated_at" => updated_at
|
||||
}
|
||||
end
|
||||
|
||||
def update_category_pseudo_tags_for_posts_async
|
||||
if category_changed?
|
||||
delay(:queue => "default").update_category_pseudo_tags_for_posts
|
||||
|
||||
Reference in New Issue
Block a user