diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-10-23 18:53:13 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-10-23 18:53:44 -0700 |
commit | 838cb1aa507746b3562931bb63cf4f474363e17a (patch) | |
tree | 24f082167892301d7c12994fd772af83775f634c /activerecord/lib | |
parent | 5366e61458cb642429a80297abefddcda6696abe (diff) | |
download | rails-838cb1aa507746b3562931bb63cf4f474363e17a.tar.gz rails-838cb1aa507746b3562931bb63cf4f474363e17a.tar.bz2 rails-838cb1aa507746b3562931bb63cf4f474363e17a.zip |
Skip collection ids reader optimization if using :finder_sql
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 187caa13d0..52f6a04da1 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1296,7 +1296,7 @@ module ActiveRecord end define_method("#{reflection.name.to_s.singularize}_ids") do - if send(reflection.name).loaded? + if send(reflection.name).loaded? || reflection.options[:finder_sql] send(reflection.name).map(&:id) else send(reflection.name).all(:select => "#{reflection.quoted_table_name}.#{reflection.klass.primary_key}").map(&:id) |