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/relation/query_methods.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/relation/query_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 0749bb30b5..3b86f1c605 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -2,9 +2,9 @@ require "active_record/relation/from_clause" require "active_record/relation/query_attribute" require "active_record/relation/where_clause" require "active_record/relation/where_clause_factory" -require 'active_model/forbidden_attributes_protection' -require 'active_support/core_ext/string/filters' -require 'active_support/core_ext/regexp' +require "active_model/forbidden_attributes_protection" +require "active_support/core_ext/string/filters" +require "active_support/core_ext/regexp" module ActiveRecord module QueryMethods @@ -271,7 +271,7 @@ module ActiveRecord # # => ActiveModel::MissingAttributeError: missing attribute: other_field def select(*fields) return super if block_given? - raise ArgumentError, 'Call this with at least one field' if fields.empty? + raise ArgumentError, "Call this with at least one field" if fields.empty? spawn._select!(*fields) end @@ -1014,7 +1014,7 @@ module ActiveRecord name = from_clause.name case opts when Relation - name ||= 'subquery' + name ||= "subquery" opts.arel.as(name.to_s) else opts @@ -1027,7 +1027,7 @@ module ActiveRecord when Hash, Symbol, Array :association_join else - raise ArgumentError, 'only Hash, Symbol and Array are allowed' + raise ArgumentError, "only Hash, Symbol and Array are allowed" end end @@ -1046,7 +1046,7 @@ module ActiveRecord when Arel::Nodes::Join :join_node else - raise 'unknown class: %s' % join.class.name + raise "unknown class: %s" % join.class.name end end @@ -1125,9 +1125,9 @@ module ActiveRecord if does_not_support_reverse?(o) raise IrreversibleOrderError, "Order #{o.inspect} can not be reversed automatically" end - o.split(',').map! do |s| + o.split(",").map! do |s| s.strip! - s.gsub!(/\sasc\Z/i, ' DESC') || s.gsub!(/\sdesc\Z/i, ' ASC') || s.concat(' DESC') + s.gsub!(/\sasc\Z/i, " DESC") || s.gsub!(/\sdesc\Z/i, " ASC") || s.concat(" DESC") end else o @@ -1150,7 +1150,7 @@ module ActiveRecord end VALID_DIRECTIONS = [:asc, :desc, :ASC, :DESC, - 'asc', 'desc', 'ASC', 'DESC'] # :nodoc: + "asc", "desc", "ASC", "DESC"] # :nodoc: def validate_order_args(args) args.each do |arg| |