Class: SDL::Association::HasMany

Inherits:
SDL::Association show all
Defined in:
lib/sdl/association.rb

Overview

Indicates a one-to-many connection with another Model

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from SDL::Field

Instance Method Details

#model_nameName

The name of the associated model

Returns:


34
35
36
37
38
39
40
# File 'lib/sdl/association.rb', line 34

def model_name
  model_name = options.fetch(:model_name) do
    ActiveSupport::Inflector.singularize(name.to_s)
  end

  Name.new(model_name.to_s)
end

#typeSymbol

The type of field

Returns:

  • (Symbol)

28
29
30
# File 'lib/sdl/association.rb', line 28

def type
  :has_many
end