Class: ActiveMocker::ActiveRecord::Relationships::HasMany Private
- Inherits:
-
Relationship
- Object
- Relationship
- ActiveMocker::ActiveRecord::Relationships::HasMany
- Defined in:
- lib/active_mocker/active_record/relationships.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #klass_name ⇒ Object readonly private
Attributes inherited from Relationship
Instance Method Summary collapse
- #foreign_key ⇒ Object private
-
#initialize(name, klass_name, options = {}) ⇒ HasMany
constructor
private
A new instance of HasMany.
Methods inherited from Relationship
#class_name, #join_table, #options, #through
Constructor Details
#initialize(name, klass_name, options = {}) ⇒ HasMany
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of HasMany.
64 65 66 67 |
# File 'lib/active_mocker/active_record/relationships.rb', line 64 def initialize(name, klass_name, ={}) @klass_name = klass_name super(name, ) end |
Instance Attribute Details
#klass_name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
62 63 64 |
# File 'lib/active_mocker/active_record/relationships.rb', line 62 def klass_name @klass_name end |
Instance Method Details
#foreign_key ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
69 70 71 |
# File 'lib/active_mocker/active_record/relationships.rb', line 69 def foreign_key [:foreign_key] || klass_name.to_s.foreign_key end |