Module: AmsLazyRelationships::Core::RelationshipWrapperMethods
- Included in:
- ClassMethods
- Defined in:
- lib/ams_lazy_relationships/core/relationship_wrapper_methods.rb
Overview
Defines convenience methods - wraps ‘has_many/belongs_to/has_one` and defines a lazy_has_many, lazy_has_one and lazy_belongs_to.
Calling lazy_has_one in your serializer class will:
-
define a lazy_relationship
-
define a has_one relationship
You can optionally pass a block, just like in standard AMS relationships If block is not present it’ll call ‘lazy_xxx` method where `xxx` is the name of the relationship.