aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorheavysixer <heavysixer@gmail.com>2008-10-25 13:33:39 -0500
committerheavysixer <heavysixer@gmail.com>2008-10-25 13:33:39 -0500
commit14f05140e53f4f58bc86ee08b9a4ba836c14f9be (patch)
tree03b975c55bb42b964edc8a3507f63f92487a42ed /activerecord/lib
parent35f29f7ea5ba183e49e26367cc31649ff4bd0e97 (diff)
parent650aa015789c704ca8ea864f1117faf3f404a59b (diff)
downloadrails-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-xactiverecord/lib/active_record/associations.rb2
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)