Module: ActiveModel::Serializer::Associations::ClassMethods
- Defined in:
- lib/active_model/serializer/associations.rb
Instance Method Summary (collapse)
- - (void) belongs_to(name, options = {}, &block)
- - (void) has_many(name, options = {}, &block)
- - (void) has_one(name, options = {}, &block)
- - (Object) inherited(base)
Instance Method Details
- (void) belongs_to(name, options = {}, &block)
This method returns an undefined value.
55 56 57 |
# File 'lib/active_model/serializer/associations.rb', line 55 def belongs_to(name, = {}, &block) associate(BelongsToReflection.new(name, , block)) end |
- (void) has_many(name, options = {}, &block)
This method returns an undefined value.
44 45 46 |
# File 'lib/active_model/serializer/associations.rb', line 44 def has_many(name, = {}, &block) associate(HasManyReflection.new(name, , block)) end |
- (void) has_one(name, options = {}, &block)
This method returns an undefined value.
66 67 68 |
# File 'lib/active_model/serializer/associations.rb', line 66 def has_one(name, = {}, &block) associate(HasOneReflection.new(name, , block)) end |
- (Object) inherited(base)
32 33 34 35 |
# File 'lib/active_model/serializer/associations.rb', line 32 def inherited(base) super base._reflections = _reflections.dup end |