mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06:50 +00:00
Associations::Config is now Associations::Base
This commit is contained in:
parent
2b22acff53
commit
03669a74bc
@ -1,7 +1,7 @@
|
|||||||
module ActiveModel
|
module ActiveModel
|
||||||
class Serializer
|
class Serializer
|
||||||
module Associations #:nodoc:
|
module Associations #:nodoc:
|
||||||
class Config #:nodoc:
|
class Base #:nodoc:
|
||||||
def initialize(name, options={}, serializer_options={})
|
def initialize(name, options={}, serializer_options={})
|
||||||
@name = name
|
@name = name
|
||||||
@options = options
|
@options = options
|
||||||
@ -60,7 +60,7 @@ module ActiveModel
|
|||||||
attr_reader :options, :serializer_options
|
attr_reader :options, :serializer_options
|
||||||
end
|
end
|
||||||
|
|
||||||
class HasMany < Config #:nodoc:
|
class HasMany < Base #:nodoc:
|
||||||
def key
|
def key
|
||||||
if key = options[:key]
|
if key = options[:key]
|
||||||
key
|
key
|
||||||
@ -102,7 +102,7 @@ module ActiveModel
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class HasOne < Config #:nodoc:
|
class HasOne < Base #:nodoc:
|
||||||
def embeddable?
|
def embeddable?
|
||||||
if polymorphic? && associated_object.nil?
|
if polymorphic? && associated_object.nil?
|
||||||
false
|
false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user