From d5fb37f675194432be8b9b5415e4fefad88d5464 Mon Sep 17 00:00:00 2001 From: Type-kun Date: Fri, 26 Aug 2016 23:18:11 +0500 Subject: [PATCH] Display flag creator ID in API for Mod+ Completely fixes #2640 --- app/models/post_flag.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/post_flag.rb b/app/models/post_flag.rb index 480c19e78..9ba8378e7 100644 --- a/app/models/post_flag.rb +++ b/app/models/post_flag.rb @@ -79,7 +79,11 @@ class PostFlag < ActiveRecord::Base module ApiMethods def hidden_attributes - super + [:creator_id] + list = [] + unless CurrentUser.is_moderator? + list += [:creator_id] + end + super + list end def serializable_hash(options = {})