mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Remove some Symbol#to_proc usage in runtime code. [#484 state:resolved]
This commit is contained in:
committed by
Jeremy Kemper
parent
11252e35b1
commit
ce4a1bb853
@@ -1145,7 +1145,7 @@ module ActiveRecord
|
||||
end
|
||||
|
||||
define_method("#{reflection.name.to_s.singularize}_ids") do
|
||||
send(reflection.name).map(&:id)
|
||||
send(reflection.name).map { |record| record.id }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1490,7 +1490,7 @@ module ActiveRecord
|
||||
sql << " FROM #{connection.quote_table_name table_name} "
|
||||
|
||||
if is_distinct
|
||||
sql << distinct_join_associations.collect(&:association_join).join
|
||||
sql << distinct_join_associations.collect { |assoc| assoc.association_join }.join
|
||||
add_joins!(sql, options, scope)
|
||||
end
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ module ActiveRecord
|
||||
# If using a custom finder_sql, scan the entire collection.
|
||||
if @reflection.options[:finder_sql]
|
||||
expects_array = args.first.kind_of?(Array)
|
||||
ids = args.flatten.compact.uniq.map(&:to_i)
|
||||
ids = args.flatten.compact.uniq.map { |arg| arg.to_i }
|
||||
|
||||
if ids.size == 1
|
||||
id = ids.first
|
||||
|
||||
@@ -61,9 +61,9 @@ module ActiveRecord
|
||||
def delete_records(records)
|
||||
case @reflection.options[:dependent]
|
||||
when :destroy
|
||||
records.each(&:destroy)
|
||||
records.each { |r| r.destroy }
|
||||
when :delete_all
|
||||
@reflection.klass.delete(records.map(&:id))
|
||||
@reflection.klass.delete(records.map { |record| record.id })
|
||||
else
|
||||
ids = quoted_record_ids(records)
|
||||
@reflection.klass.update_all(
|
||||
|
||||
Reference in New Issue
Block a user