Skip to content

Instantly share code, notes, and snippets.

@neerajsingh0101
Created June 25, 2013 07:22
Show Gist options
  • Save neerajsingh0101/5856608 to your computer and use it in GitHub Desktop.
Save neerajsingh0101/5856608 to your computer and use it in GitHub Desktop.
1) Error:
EagerAssociationTest#test_include_has_one_using_primary_key:
ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: id: SELECT "companies"."id" AS t0_r0, "companies"."type" AS t0_r1, "companies"."firm_id" AS t0_r2, "companies"."firm_name" AS t0_r3, "companies"."name" AS t0_r4, "companies"."client_of" AS t0_r5, "companies"."rating" AS t0_r6, "companies"."account_id" AS t0_r7, "companies"."description" AS t0_r8, "accounts"."id" AS t1_r0, "accounts"."firm_id" AS t1_r1, "accounts"."firm_name" AS t1_r2, "accounts"."credit_limit" AS t1_r3 FROM "companies" LEFT OUTER JOIN "accounts" ON "accounts"."firm_id" = "companies"."firm_id" WHERE "companies"."type" IN ('Firm') ORDER BY id, accounts.id
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `initialize'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `new'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `prepare'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:296:in `block in exec_query'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:438:in `block in log'
/Users/nsingh/dev/rails_edge/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:433:in `log'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:292:in `exec_query'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:504:in `select'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:24:in `select_all'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation/finder_methods.rb:248:in `find_with_associations'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:600:in `exec_queries'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:484:in `load'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:233:in `to_a'
/Users/nsingh/dev/rails_edge/rails/activerecord/test/cases/associations/eager_test.rb:1085:in `test_include_has_one_using_primary_key'
2) Error:
EagerAssociationTest#test_loading_with_one_association_with_non_preload:
ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: id: SELECT "posts"."id" AS t0_r0, "posts"."author_id" AS t0_r1, "posts"."title" AS t0_r2, "posts"."body" AS t0_r3, "posts"."type" AS t0_r4, "posts"."comments_count" AS t0_r5, "posts"."taggings_count" AS t0_r6, "posts"."taggings_with_delete_all_count" AS t0_r7, "posts"."taggings_with_destroy_count" AS t0_r8, "posts"."tags_count" AS t0_r9, "posts"."tags_with_destroy_count" AS t0_r10, "posts"."tags_with_nullify_count" AS t0_r11, "comments"."id" AS t1_r0, "comments"."post_id" AS t1_r1, "comments"."body" AS t1_r2, "comments"."type" AS t1_r3, "comments"."taggings_count" AS t1_r4, "comments"."children_count" AS t1_r5, "comments"."parent_id" AS t1_r6 FROM "posts" LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id" ORDER BY id desc, comments.id DESC
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `initialize'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `new'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `prepare'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:296:in `block in exec_query'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:438:in `block in log'
/Users/nsingh/dev/rails_edge/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:433:in `log'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:292:in `exec_query'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:504:in `select'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:24:in `select_all'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation/finder_methods.rb:248:in `find_with_associations'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:600:in `exec_queries'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:484:in `load'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:233:in `to_a'
/Users/nsingh/dev/rails_edge/rails/activerecord/test/cases/associations/eager_test.rb:53:in `test_loading_with_one_association_with_non_preload'
3) Error:
RelationTest#test_loading_with_one_association_with_non_preload:
ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: id: SELECT "posts"."id" AS t0_r0, "posts"."author_id" AS t0_r1, "posts"."title" AS t0_r2, "posts"."body" AS t0_r3, "posts"."type" AS t0_r4, "posts"."comments_count" AS t0_r5, "posts"."taggings_count" AS t0_r6, "posts"."taggings_with_delete_all_count" AS t0_r7, "posts"."taggings_with_destroy_count" AS t0_r8, "posts"."tags_count" AS t0_r9, "posts"."tags_with_destroy_count" AS t0_r10, "posts"."tags_with_nullify_count" AS t0_r11, "comments"."id" AS t1_r0, "comments"."post_id" AS t1_r1, "comments"."body" AS t1_r2, "comments"."type" AS t1_r3, "comments"."taggings_count" AS t1_r4, "comments"."children_count" AS t1_r5, "comments"."parent_id" AS t1_r6 FROM "posts" LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id" ORDER BY id desc, comments.id DESC
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `initialize'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `new'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `prepare'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:296:in `block in exec_query'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:438:in `block in log'
/Users/nsingh/dev/rails_edge/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:433:in `log'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:292:in `exec_query'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:504:in `select'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:24:in `select_all'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation/finder_methods.rb:248:in `find_with_associations'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:600:in `exec_queries'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:484:in `load'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:233:in `to_a'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation/finder_methods.rb:63:in `find'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activerecord-deprecated_finders-1.0.3/lib/active_record/deprecated_finders/relation.rb:122:in `find'
/Users/nsingh/dev/rails_edge/rails/activerecord/test/cases/relations_test.rb:486:in `test_loading_with_one_association_with_non_preload'
4) Error:
RelationTest#test_relation_merging_with_eager_load:
ActiveRecord::StatementInvalid: SQLite3::SQLException: ambiguous column name: id: SELECT "posts"."id" AS t0_r0, "posts"."author_id" AS t0_r1, "posts"."title" AS t0_r2, "posts"."body" AS t0_r3, "posts"."type" AS t0_r4, "posts"."comments_count" AS t0_r5, "posts"."taggings_count" AS t0_r6, "posts"."taggings_with_delete_all_count" AS t0_r7, "posts"."taggings_with_destroy_count" AS t0_r8, "posts"."tags_count" AS t0_r9, "posts"."tags_with_destroy_count" AS t0_r10, "posts"."tags_with_nullify_count" AS t0_r11, "comments"."id" AS t1_r0, "comments"."post_id" AS t1_r1, "comments"."body" AS t1_r2, "comments"."type" AS t1_r3, "comments"."taggings_count" AS t1_r4, "comments"."children_count" AS t1_r5, "comments"."parent_id" AS t1_r6 FROM "posts" LEFT OUTER JOIN "comments" ON "comments"."post_id" = "posts"."id" ORDER BY id desc, comments.id DESC
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `initialize'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `new'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.7/lib/sqlite3/database.rb:91:in `prepare'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:296:in `block in exec_query'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:438:in `block in log'
/Users/nsingh/dev/rails_edge/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:433:in `log'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:292:in `exec_query'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:504:in `select'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:24:in `select_all'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation/finder_methods.rb:248:in `find_with_associations'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:600:in `exec_queries'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:484:in `load'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation.rb:233:in `to_a'
/Users/nsingh/dev/rails_edge/rails/activerecord/lib/active_record/relation/finder_methods.rb:63:in `find'
/Users/nsingh/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activerecord-deprecated_finders-1.0.3/lib/active_record/deprecated_finders/relation.rb:122:in `find'
/Users/nsingh/dev/rails_edge/rails/activerecord/test/cases/relations_test.rb:751:in `block in test_relation_merging_with_eager_load'
/Users/nsingh/dev/rails_edge/rails/activerecord/test/cases/relations_test.rb:750:in `each'
/Users/nsingh/dev/rails_edge/rails/activerecord/test/cases/relations_test.rb:750:in `test_relation_merging_with_eager_load'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment