aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAnatoliy Lysenko <a.o.lysenko@gmail.com>2011-03-27 16:40:37 +0300
committerAnatoliy Lysenko <a.o.lysenko@gmail.com>2011-07-06 23:23:34 +0300
commit66dd2d3d10edd501c33a6aead035691a6a54f6c7 (patch)
tree0fa3113ae929783d4ba5b9412832a84fd2daa273 /activerecord/lib
parentc713cf9a5d9db60c4387e74acb9de66e3e7f9b37 (diff)
downloadrails-66dd2d3d10edd501c33a6aead035691a6a54f6c7.tar.gz
rails-66dd2d3d10edd501c33a6aead035691a6a54f6c7.tar.bz2
rails-66dd2d3d10edd501c33a6aead035691a6a54f6c7.zip
Fix bug in collection_singular_ids on has many through association with conditions and includes,
when condtions references tables from includes. Test fail because of invalid sql: ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: comments.id: SELECT "posts".id FROM "posts" INNER JOIN "readers" ON "posts"."id" = "readers"."post_id" WHERE "readers"."person_id" = 1 AND (comments.id is null) Bug described in github#925 This commit will revert fix from https://github.com/rails/rails/commit/3436fdfc12d58925e3d981e0afa61084ea34736c , but tests is ok. Bug described in #6569 ticket.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index c15ee18e53..3e68f973e7 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -50,7 +50,7 @@ module ActiveRecord
else
column = "#{reflection.quoted_table_name}.#{reflection.association_primary_key}"
- scoped.select(column).except(:includes).map! do |record|
+ scoped.select(column).map! do |record|
record.send(reflection.association_primary_key)
end
end