diff --git a/app/models/post_flag.rb b/app/models/post_flag.rb index ede7c0a30..480c19e78 100644 --- a/app/models/post_flag.rb +++ b/app/models/post_flag.rb @@ -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? diff --git a/app/models/user.rb b/app/models/user.rb index ed3cfa018..e78c8075d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -610,7 +610,7 @@ class User < ActiveRecord::Base module ApiMethods def hidden_attributes - super + [:password_hash, :bcrypt_password_hash, :email, :email_verification_key, :time_zone, :updated_at, :receive_email_notifications, :last_logged_in_at, :last_forum_read_at, :has_mail, :default_image_size, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :recent_tags, :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :enable_sequential_post_navigation, :hide_deleted_posts, :per_page, :style_usernames, :enable_auto_complete, :custom_style, :show_deleted_children, :has_saved_searches, :last_ip_addr] + super + [:password_hash, :bcrypt_password_hash, :email, :email_verification_key, :time_zone, :updated_at, :receive_email_notifications, :last_logged_in_at, :last_forum_read_at, :has_mail, :default_image_size, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :recent_tags, :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :enable_sequential_post_navigation, :hide_deleted_posts, :per_page, :style_usernames, :enable_auto_complete, :custom_style, :show_deleted_children, :has_saved_searches, :last_ip_addr, :bit_prefs] end def method_attributes