mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
5
test/fixtures/poro.rb
vendored
5
test/fixtures/poro.rb
vendored
@@ -50,6 +50,11 @@ class ProfileSerializer < ActiveModel::Serializer
|
||||
scope ? "#{description} - #{scope}" : description
|
||||
end
|
||||
|
||||
def name
|
||||
name = object.read_attribute_for_serialization(:name)
|
||||
options[:custom_name] ? "#{name} - #{options[:custom_name]}" : name
|
||||
end
|
||||
|
||||
attributes :name, :description
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user