mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Do not convert attrs to String until needed
This commit is contained in:
parent
daa9304398
commit
f6ea07dd22
@ -64,8 +64,6 @@ module ActiveModel
|
|||||||
options = attrs.extract_options!
|
options = attrs.extract_options!
|
||||||
|
|
||||||
attrs.each do |attr|
|
attrs.each do |attr|
|
||||||
attr = attr.to_s
|
|
||||||
|
|
||||||
unless method_defined?(attr)
|
unless method_defined?(attr)
|
||||||
define_method attr do
|
define_method attr do
|
||||||
object.send attr
|
object.send attr
|
||||||
|
|||||||
@ -5,7 +5,7 @@ module ActiveModel
|
|||||||
class Serializer
|
class Serializer
|
||||||
class Association
|
class Association
|
||||||
def initialize(name, options={})
|
def initialize(name, options={})
|
||||||
@name = name
|
@name = name.to_s
|
||||||
@options = options
|
@options = options
|
||||||
|
|
||||||
self.embed = options[:embed] || SETTINGS[:embed]
|
self.embed = options[:embed] || SETTINGS[:embed]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user