Method: Mongoid::Relations::Accessors::ClassMethods#getter
- Defined in:
- lib/mongoid/relations/accessors.rb
#getter(name, metadata) ⇒ Class
Defines the getter for the relation. Nothing too special here: just return the instance variable for the relation if it exists or build the thing.
221 222 223 224 225 226 |
# File 'lib/mongoid/relations/accessors.rb', line 221 def getter(name, ) re_define_method(name) do |reload = false| get_relation(name, , reload) end self end |