Class: ActiveSchema::Associations::ByForwardForeignKey

Inherits:
ByForeignKey
  • Object
show all
Defined in:
lib/active_schema/associations/by_foreign_key.rb

Instance Method Summary collapse

Methods inherited from ByForeignKey

#association, #initialize

Methods included from Naming

#name_for, #plural_name_for

Constructor Details

This class inherits a constructor from ActiveSchema::Associations::ByForeignKey

Instance Method Details

#generateObject



27
28
29
30
31
# File 'lib/active_schema/associations/by_foreign_key.rb', line 27

def generate
  association @from_model, :belongs_to,
    name_for(@to_model),
    { :class_name => @to_model.name, :foreign_key => @key_column }
end