Class: SDL::Association::HasMany
- Inherits:
-
SDL::Association
- Object
- Field
- SDL::Association
- SDL::Association::HasMany
- Defined in:
- lib/sdl/association.rb
Overview
Indicates a one-to-many connection with another Model
Instance Method Summary collapse
-
#model_name ⇒ Name
The name of the associated model.
-
#type ⇒ Symbol
The type of field.
Constructor Details
This class inherits a constructor from SDL::Field
Instance Method Details
#model_name ⇒ Name
The name of the associated model
34 35 36 37 38 39 40 |
# File 'lib/sdl/association.rb', line 34 def model_name model_name = .fetch(:model_name) do ActiveSupport::Inflector.singularize(name.to_s) end Name.new(model_name.to_s) end |
#type ⇒ Symbol
The type of field
28 29 30 |
# File 'lib/sdl/association.rb', line 28 def type :has_many end |