diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:24:04 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:26:45 +0200 |
commit | 4df2b779ddfcb27761c71e00e2b241bfa06a0950 (patch) | |
tree | 7a83cce62195f7b20afea6d6a8873b953d25cb84 /activerecord/lib/active_record/dynamic_matchers.rb | |
parent | a731125f12c5834de7eae3455fad63ea4d348034 (diff) | |
download | rails-4df2b779ddfcb27761c71e00e2b241bfa06a0950.tar.gz rails-4df2b779ddfcb27761c71e00e2b241bfa06a0950.tar.bz2 rails-4df2b779ddfcb27761c71e00e2b241bfa06a0950.zip |
applies new string literal convention in activerecord/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
Diffstat (limited to 'activerecord/lib/active_record/dynamic_matchers.rb')
-rw-r--r-- | activerecord/lib/active_record/dynamic_matchers.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/dynamic_matchers.rb b/activerecord/lib/active_record/dynamic_matchers.rb index 0bdebb3989..b41546064b 100644 --- a/activerecord/lib/active_record/dynamic_matchers.rb +++ b/activerecord/lib/active_record/dynamic_matchers.rb @@ -1,4 +1,4 @@ -require 'active_support/core_ext/regexp' +require "active_support/core_ext/regexp" module ActiveRecord module DynamicMatchers #:nodoc: @@ -44,7 +44,7 @@ module ActiveRecord end def suffix - '' + "" end end @@ -53,7 +53,7 @@ module ActiveRecord def initialize(model, name) @model = model @name = name.to_s - @attribute_names = @name.match(self.class.pattern)[1].split('_and_') + @attribute_names = @name.match(self.class.pattern)[1].split("_and_") @attribute_names.map! { |n| @model.attribute_aliases[n] || n } end @@ -78,13 +78,13 @@ module ActiveRecord # The parameters in the signature may have reserved Ruby words, in order # to prevent errors, we start each param name with `_`. def signature - attribute_names.map { |name| "_#{name}" }.join(', ') + attribute_names.map { |name| "_#{name}" }.join(", ") end # Given that the parameters starts with `_`, the finder needs to use the # same parameter name. def attributes_hash - "{" + attribute_names.map { |name| ":#{name} => _#{name}" }.join(',') + "}" + "{" + attribute_names.map { |name| ":#{name} => _#{name}" }.join(",") + "}" end def finder |