Skip to content

Commit bc7f77b

Browse files
committed
Linting
I am working on this file in another branch and my OCD saw some missing parens. Prefer this to be an independent patch.
1 parent 58ecdf9 commit bc7f77b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

activerecord/lib/active_record/associations.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ module ClassMethods
13011301
# has_many :comments, index_errors: :nested_attributes_order
13021302
def has_many(name, scope = nil, **options, &extension)
13031303
reflection = Builder::HasMany.build(self, name, scope, options, &extension)
1304-
Reflection.add_reflection self, name, reflection
1304+
Reflection.add_reflection(self, name, reflection)
13051305
end
13061306

13071307
# Specifies a one-to-one association with another class. This method
@@ -1497,7 +1497,7 @@ def has_many(name, scope = nil, **options, &extension)
14971497
# has_one :employment_record_book, query_constraints: [:organization_id, :employee_id]
14981498
def has_one(name, scope = nil, **options)
14991499
reflection = Builder::HasOne.build(self, name, scope, options)
1500-
Reflection.add_reflection self, name, reflection
1500+
Reflection.add_reflection(self, name, reflection)
15011501
end
15021502

15031503
# Specifies a one-to-one association with another class. This method
@@ -1688,7 +1688,7 @@ def has_one(name, scope = nil, **options)
16881688
# belongs_to :note, query_constraints: [:organization_id, :note_id]
16891689
def belongs_to(name, scope = nil, **options)
16901690
reflection = Builder::BelongsTo.build(self, name, scope, options)
1691-
Reflection.add_reflection self, name, reflection
1691+
Reflection.add_reflection(self, name, reflection)
16921692
end
16931693

16941694
# 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)
18701870
def has_and_belongs_to_many(name, scope = nil, **options, &extension)
18711871
habtm_reflection = ActiveRecord::Reflection::HasAndBelongsToManyReflection.new(name, scope, options, self)
18721872

1873-
builder = Builder::HasAndBelongsToMany.new name, self, options
1873+
builder = Builder::HasAndBelongsToMany.new(name, self, options)
18741874

18751875
join_model = builder.through_model
18761876

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)
18791879

1880-
middle_reflection = builder.middle_reflection join_model
1880+
middle_reflection = builder.middle_reflection(join_model)
18811881

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)
18841884
middle_reflection.parent_reflection = habtm_reflection
18851885

18861886
include Module.new {
@@ -1898,7 +1898,7 @@ def destroy_associations
18981898
hm_options[:source] = join_model.right_reflection.name
18991899

19001900
[: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)
19021902
end
19031903

19041904
has_many name, scope, **hm_options, &extension

0 commit comments

Comments
 (0)