mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Do not call send on associated objects, do it through elem.read_attribute_for_serialization
This commit is contained in:
10
test/fixtures/poro.rb
vendored
10
test/fixtures/poro.rb
vendored
@@ -4,11 +4,11 @@ class Model
|
||||
end
|
||||
|
||||
def read_attribute_for_serialization(name)
|
||||
@attributes[name]
|
||||
end
|
||||
|
||||
def id
|
||||
object_id
|
||||
if name == :id || name == 'id'
|
||||
object_id
|
||||
else
|
||||
@attributes[name]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user