aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMohsen Alizadeh <mohsen@alizadeh.us>2017-11-12 15:36:07 +0330
committerMohsen Alizadeh <mohsen@alizadeh.us>2017-11-12 15:36:07 +0330
commit2dafbeed5e2afc001aa64ebf6363f350a6f259ac (patch)
tree4258f825de67164fc4ad16646c7e7070702bab87 /activerecord
parenta34a0cccfa1aa436d8f4b7df402fc8035fc22397 (diff)
downloadrails-2dafbeed5e2afc001aa64ebf6363f350a6f259ac.tar.gz
rails-2dafbeed5e2afc001aa64ebf6363f350a6f259ac.tar.bz2
rails-2dafbeed5e2afc001aa64ebf6363f350a6f259ac.zip
sanitize empty and nil parameters to select
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index 34554450dd..eec907e9cf 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -231,6 +231,7 @@ module ActiveRecord
end
def _select!(*fields) # :nodoc:
+ fields.reject!(&:blank?)
fields.flatten!
fields.map! do |field|
klass.attribute_alias?(field) ? klass.attribute_alias(field).to_sym : field