-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
class MyItemObject
include ActiveAttr::Model
attribute :one
attribute :two
end
Class MyObject
include ActiveAttr::Model
attribute :my_objects, type: [MyArrayObject], typecaster: -> { |values| values.map { |value| MyItemObject.new(value) }
end
object = MyObject.from_json(json_dump)
puts object.my_objects.object_id
puts object.my_objects.object_idThis will produce a different object_id at each run. Can't say I expected this. If typecasting results are temporary perhaps they should be returned as frozen?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels