Class: ActiveSchema::Associations::ByForeignKey
- Inherits:
-
Object
- Object
- ActiveSchema::Associations::ByForeignKey
- Includes:
- Naming
- Defined in:
- lib/active_schema/associations/by_foreign_key.rb
Direct Known Subclasses
Instance Method Summary collapse
- #association(receiver, method_name, name, opts = {}) ⇒ Object
-
#initialize(from_model, to_model, key_column, key_column_unique) ⇒ ByForeignKey
constructor
A new instance of ByForeignKey.
Methods included from Naming
Constructor Details
#initialize(from_model, to_model, key_column, key_column_unique) ⇒ ByForeignKey
Returns a new instance of ByForeignKey.
14 15 16 17 18 19 |
# File 'lib/active_schema/associations/by_foreign_key.rb', line 14 def initialize(from_model, to_model, key_column, key_column_unique) @from_model = from_model @to_model = to_model @key_column = key_column @key_column_unique = key_column_unique end |
Instance Method Details
#association(receiver, method_name, name, opts = {}) ⇒ Object
21 22 23 |
# File 'lib/active_schema/associations/by_foreign_key.rb', line 21 def association(receiver, method_name, name, opts = {}) receiver.send(method_name, name, opts) end |