Module: ActiveModel::Serializer::Associations::ClassMethods
- Defined in:
- lib/active_model/serializer/associations.rb
Instance Method Summary collapse
- #belongs_to(name, options = {}) ⇒ void
- #has_many(name, options = {}) ⇒ void
- #has_one(name, options = {}) ⇒ void
- #inherited(base) ⇒ Object
Instance Method Details
#belongs_to(name, options = {}) ⇒ void
This method returns an undefined value.
50 51 52 |
# File 'lib/active_model/serializer/associations.rb', line 50 def belongs_to(name, = {}) associate BelongsToReflection.new(name, ) end |
#has_many(name, options = {}) ⇒ void
This method returns an undefined value.
39 40 41 |
# File 'lib/active_model/serializer/associations.rb', line 39 def has_many(name, = {}) associate HasManyReflection.new(name, ) end |
#has_one(name, options = {}) ⇒ void
This method returns an undefined value.
61 62 63 |
# File 'lib/active_model/serializer/associations.rb', line 61 def has_one(name, = {}) associate HasOneReflection.new(name, ) end |
#inherited(base) ⇒ Object
28 29 30 |
# File 'lib/active_model/serializer/associations.rb', line 28 def inherited(base) base._reflections = self._reflections.try(:dup) || [] end |