diff options
author | heavysixer <heavysixer@gmail.com> | 2008-10-25 13:33:39 -0500 |
---|---|---|
committer | heavysixer <heavysixer@gmail.com> | 2008-10-25 13:33:39 -0500 |
commit | 14f05140e53f4f58bc86ee08b9a4ba836c14f9be (patch) | |
tree | 03b975c55bb42b964edc8a3507f63f92487a42ed /activerecord/lib | |
parent | 35f29f7ea5ba183e49e26367cc31649ff4bd0e97 (diff) | |
parent | 650aa015789c704ca8ea864f1117faf3f404a59b (diff) | |
download | rails-14f05140e53f4f58bc86ee08b9a4ba836c14f9be.tar.gz rails-14f05140e53f4f58bc86ee08b9a4ba836c14f9be.tar.bz2 rails-14f05140e53f4f58bc86ee08b9a4ba836c14f9be.zip |
Merge branch 'master' of git@github.com:lifo/docrails
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) |