Skip to content

Commit b9d6759

Browse files
committed
Style pass over active_record/associations/builder/association.rb
I was reading this source code and made a few edits on passing to ensure style details agree within the file itself and Rails. The addition of "# noop" makes the method body look similar to other analogous ones in the same file (not shown in the diff).
1 parent f0f624b commit b9d6759

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

activerecord/lib/active_record/associations/builder/association.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def self.build(model, name, scope, options, &block)
3030
end
3131

3232
reflection = create_reflection(model, name, scope, options, &block)
33-
define_accessors model, reflection
34-
define_callbacks model, reflection
35-
define_validations model, reflection
36-
define_change_tracking_methods model, reflection
33+
define_accessors(model, reflection)
34+
define_callbacks(model, reflection)
35+
define_validations(model, reflection)
36+
define_change_tracking_methods(model, reflection)
3737
reflection
3838
end
3939

@@ -71,6 +71,7 @@ def self.validate_options(options)
7171
end
7272

7373
def self.define_extensions(model, name)
74+
# noop
7475
end
7576

7677
def self.define_callbacks(model, reflection)
@@ -81,7 +82,7 @@ def self.define_callbacks(model, reflection)
8182
end
8283

8384
Association.extensions.each do |extension|
84-
extension.build model, reflection
85+
extension.build(model, reflection)
8586
end
8687
end
8788

@@ -131,7 +132,7 @@ def self.check_dependent_options(dependent, model)
131132
err_message = "A valid destroy_association_async_job is required to use `dependent: :destroy_async` on associations"
132133
raise ActiveRecord::ConfigurationError, err_message
133134
end
134-
unless valid_dependent_options.include? dependent
135+
unless valid_dependent_options.include?(dependent)
135136
raise ArgumentError, "The :dependent option must be one of #{valid_dependent_options}, but is :#{dependent}"
136137
end
137138
end

0 commit comments

Comments
 (0)