Nest scope under context option

This commit is contained in:
Adrian Mugnolo and Santiago Pastorino
2014-01-06 15:35:21 -02:00
committed by Santiago Pastorino
parent 8bd2542ed2
commit 0d8ef2b165
9 changed files with 56 additions and 85 deletions

View File

@@ -47,7 +47,7 @@ end
class ProfileSerializer < ActiveModel::Serializer
def description
description = object.read_attribute_for_serialization(:description)
scope ? "#{description} - #{scope}" : description
context[:scope] ? "#{description} - #{context[:scope]}" : description
end
attributes :name, :description