@@ -1301,7 +1301,7 @@ module ClassMethods
1301
1301
# has_many :comments, index_errors: :nested_attributes_order
1302
1302
def has_many ( name , scope = nil , **options , &extension )
1303
1303
reflection = Builder ::HasMany . build ( self , name , scope , options , &extension )
1304
- Reflection . add_reflection self , name , reflection
1304
+ Reflection . add_reflection ( self , name , reflection )
1305
1305
end
1306
1306
1307
1307
# Specifies a one-to-one association with another class. This method
@@ -1497,7 +1497,7 @@ def has_many(name, scope = nil, **options, &extension)
1497
1497
# has_one :employment_record_book, query_constraints: [:organization_id, :employee_id]
1498
1498
def has_one ( name , scope = nil , **options )
1499
1499
reflection = Builder ::HasOne . build ( self , name , scope , options )
1500
- Reflection . add_reflection self , name , reflection
1500
+ Reflection . add_reflection ( self , name , reflection )
1501
1501
end
1502
1502
1503
1503
# Specifies a one-to-one association with another class. This method
@@ -1688,7 +1688,7 @@ def has_one(name, scope = nil, **options)
1688
1688
# belongs_to :note, query_constraints: [:organization_id, :note_id]
1689
1689
def belongs_to ( name , scope = nil , **options )
1690
1690
reflection = Builder ::BelongsTo . build ( self , name , scope , options )
1691
- Reflection . add_reflection self , name , reflection
1691
+ Reflection . add_reflection ( self , name , reflection )
1692
1692
end
1693
1693
1694
1694
# Specifies a many-to-many relationship with another class. This associates two classes via an
@@ -1870,17 +1870,17 @@ def belongs_to(name, scope = nil, **options)
1870
1870
def has_and_belongs_to_many ( name , scope = nil , **options , &extension )
1871
1871
habtm_reflection = ActiveRecord ::Reflection ::HasAndBelongsToManyReflection . new ( name , scope , options , self )
1872
1872
1873
- builder = Builder ::HasAndBelongsToMany . new name , self , options
1873
+ builder = Builder ::HasAndBelongsToMany . new ( name , self , options )
1874
1874
1875
1875
join_model = builder . through_model
1876
1876
1877
- const_set join_model . name , join_model
1878
- private_constant join_model . name
1877
+ const_set ( join_model . name , join_model )
1878
+ private_constant ( join_model . name )
1879
1879
1880
- middle_reflection = builder . middle_reflection join_model
1880
+ middle_reflection = builder . middle_reflection ( join_model )
1881
1881
1882
- Builder ::HasMany . define_callbacks self , middle_reflection
1883
- Reflection . add_reflection self , middle_reflection . name , middle_reflection
1882
+ Builder ::HasMany . define_callbacks ( self , middle_reflection )
1883
+ Reflection . add_reflection ( self , middle_reflection . name , middle_reflection )
1884
1884
middle_reflection . parent_reflection = habtm_reflection
1885
1885
1886
1886
include Module . new {
@@ -1898,7 +1898,7 @@ def destroy_associations
1898
1898
hm_options [ :source ] = join_model . right_reflection . name
1899
1899
1900
1900
[ :before_add , :after_add , :before_remove , :after_remove , :autosave , :validate , :join_table , :class_name , :extend , :strict_loading ] . each do |k |
1901
- hm_options [ k ] = options [ k ] if options . key? k
1901
+ hm_options [ k ] = options [ k ] if options . key? ( k )
1902
1902
end
1903
1903
1904
1904
has_many name , scope , **hm_options , &extension
0 commit comments