diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-24 02:58:38 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-24 03:10:07 +0900 |
commit | fd6648d5979df6e6daf9fa7eb1d01cd87922ae32 (patch) | |
tree | e64e33fb5aad9ecfd679cb7faf828d794f705c0f /activerecord/lib | |
parent | df35204ed190086ec95b308ac1764571344005a6 (diff) | |
download | rails-fd6648d5979df6e6daf9fa7eb1d01cd87922ae32.tar.gz rails-fd6648d5979df6e6daf9fa7eb1d01cd87922ae32.tar.bz2 rails-fd6648d5979df6e6daf9fa7eb1d01cd87922ae32.zip |
Rename local variable `n` to `name`
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/belongs_to.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/dynamic_matchers.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/builder/belongs_to.rb b/activerecord/lib/active_record/associations/builder/belongs_to.rb index 03da67f73e..321ccba918 100644 --- a/activerecord/lib/active_record/associations/builder/belongs_to.rb +++ b/activerecord/lib/active_record/associations/builder/belongs_to.rb @@ -74,11 +74,11 @@ module ActiveRecord::Associations::Builder # :nodoc: def self.add_touch_callbacks(model, reflection) foreign_key = reflection.foreign_key - n = reflection.name + name = reflection.name touch = reflection.options[:touch] callback = lambda { |changes_method| lambda { |record| - BelongsTo.touch_record(record, record.send(changes_method), foreign_key, n, touch, belongs_to_touch_method) + BelongsTo.touch_record(record, record.send(changes_method), foreign_key, name, touch, belongs_to_touch_method) }} if reflection.counter_cache_column diff --git a/activerecord/lib/active_record/dynamic_matchers.rb b/activerecord/lib/active_record/dynamic_matchers.rb index 3bb8c6f4e3..2c941b0008 100644 --- a/activerecord/lib/active_record/dynamic_matchers.rb +++ b/activerecord/lib/active_record/dynamic_matchers.rb @@ -53,7 +53,7 @@ module ActiveRecord @model = model @name = name.to_s @attribute_names = @name.match(self.class.pattern)[1].split("_and_") - @attribute_names.map! { |n| @model.attribute_aliases[n] || n } + @attribute_names.map! { |name| @model.attribute_aliases[name] || name } end def valid? |