diff options
author | Cheah Chu Yeow <chuyeow@gmail.com> | 2008-06-26 10:21:53 +0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-09 10:42:30 -0700 |
commit | ce4a1bb8538bd7cc5ee3cbf1156dc587482a7839 (patch) | |
tree | 0730d2ed46c4dd77b5ed141d37e9e41952b5c68b /activerecord/lib | |
parent | 11252e35b1756b025d8778c151f9f9a24057d1b1 (diff) | |
download | rails-ce4a1bb8538bd7cc5ee3cbf1156dc587482a7839.tar.gz rails-ce4a1bb8538bd7cc5ee3cbf1156dc587482a7839.tar.bz2 rails-ce4a1bb8538bd7cc5ee3cbf1156dc587482a7839.zip |
Remove some Symbol#to_proc usage in runtime code. [#484 state:resolved]
Diffstat (limited to 'activerecord/lib')
3 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 856d872bce..6931744058 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -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 diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index bbd8af7e76..eb39714909 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -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 diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb index cb58f0be15..e6fa15c173 100644 --- a/activerecord/lib/active_record/associations/has_many_association.rb +++ b/activerecord/lib/active_record/associations/has_many_association.rb @@ -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( |