mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Small refactoring
This commit is contained in:
parent
449849516b
commit
303ac21428
@ -97,14 +97,14 @@ end
|
||||
end
|
||||
|
||||
def define_attribute_accessor(attr)
|
||||
define_accessor_unless_defined attr do
|
||||
define_accessor_unless_defined(attr) do
|
||||
object.read_attribute_for_serialization(attr)
|
||||
end
|
||||
end
|
||||
|
||||
def define_association_accessor(attr)
|
||||
define_accessor_unless_defined attr do
|
||||
object.send attr
|
||||
define_accessor_unless_defined(attr) do
|
||||
object.__send__(attr)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user