Module: LHS::Record::Relations::ClassMethods

Defined in:
lib/lhs/concerns/record/relations.rb

Instance Method Summary collapse

Instance Method Details

#has_many(*options) ⇒ Object Also known as: has_one


17
18
19
20
21
# File 'lib/lhs/concerns/record/relations.rb', line 17

def has_many(*options)
  name = options[0]
  options = options[1] || {}
  _relations[name] = { record_class_name: options.fetch(:class_name, name.to_s.singularize.classify) }
end