FIX: only show edit reason when the user action is an EDIT
This commit is contained in:
parent
2c19d8a136
commit
90eb6e6b8f
|
@ -25,7 +25,7 @@ class UserActionSerializer < ApplicationSerializer
|
|||
:edit_reason
|
||||
|
||||
def excerpt
|
||||
PrettyText.excerpt(object.cooked,300) if object.cooked
|
||||
PrettyText.excerpt(object.cooked, 300) if object.cooked
|
||||
end
|
||||
|
||||
def avatar_template
|
||||
|
@ -39,10 +39,10 @@ class UserActionSerializer < ApplicationSerializer
|
|||
|
||||
def acting_avatar_template
|
||||
avatar_for(
|
||||
object.acting_email,
|
||||
object.acting_use_uploaded_avatar,
|
||||
object.acting_uploaded_avatar_template,
|
||||
object.acting_uploaded_avatar_id
|
||||
object.acting_email,
|
||||
object.acting_use_uploaded_avatar,
|
||||
object.acting_uploaded_avatar_template,
|
||||
object.acting_uploaded_avatar_id
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -66,7 +66,12 @@ class UserActionSerializer < ApplicationSerializer
|
|||
object.post_type == Post.types[:moderator_action]
|
||||
end
|
||||
|
||||
def edit_reason
|
||||
object.edit_reason if object.action_type == UserAction::EDIT
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def avatar_for(email, use_uploaded_avatar, uploaded_avatar_template, uploaded_avatar_id)
|
||||
# NOTE: id is required for cases where the template is blank (during initial population)
|
||||
User.new(
|
||||
|
|
Loading…
Reference in New Issue