1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

No need to use symbols

This commit is contained in:
Rafael Mendonça França 2014-02-16 21:49:28 -03:00
parent 141313c651
commit c507f9f4c9

View file

@ -240,7 +240,7 @@ module ActiveRecord
def select!(*fields) # :nodoc: def select!(*fields) # :nodoc:
fields.flatten! fields.flatten!
fields.map! do |field| fields.map! do |field|
klass.attribute_alias?(field) ? klass.attribute_alias(field).to_sym : field klass.attribute_alias?(field) ? klass.attribute_alias(field) : field
end end
self.select_values += fields self.select_values += fields
self self
@ -1052,11 +1052,11 @@ module ActiveRecord
order_args.map! do |arg| order_args.map! do |arg|
case arg case arg
when Symbol when Symbol
arg = klass.attribute_alias(arg).to_sym if klass.attribute_alias?(arg) arg = klass.attribute_alias(arg) if klass.attribute_alias?(arg)
table[arg].asc table[arg].asc
when Hash when Hash
arg.map { |field, dir| arg.map { |field, dir|
field = klass.attribute_alias(field).to_sym if klass.attribute_alias?(field) field = klass.attribute_alias(field) if klass.attribute_alias?(field)
table[field].send(dir) table[field].send(dir)
} }
else else