mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Nest scope under context option
This commit is contained in:
committed by
Santiago Pastorino
parent
8bd2542ed2
commit
0d8ef2b165
2
test/fixtures/poro.rb
vendored
2
test/fixtures/poro.rb
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user