Advertisement
Guest User

Untitled

a guest
Aug 14th, 2013
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 1.58 KB | None | 0 0
  1. DEPRECATION WARNING: It looks like you are eager loading table(s) (one of: members, responses) that are referenced in a string SQL snippet. For example:
  2.  
  3.     Post.includes(:comments).where("comments.title = 'foo'")
  4.  
  5. Currently, Active Record recognizes the table in the string, and knows to JOIN the comments table to the query, rather than loading comments in a separate query. However, doing this without writing a full-blown SQL parser is inherently flawed. Since we don't want to write an SQL parser, we are removing this functionality. From now on, you must explicitly tell Active Record when you are referencing a table from a string:
  6.  
  7.    Post.includes(:comments).where("comments.title = 'foo'").references(:comments)
  8.  
  9. If you don't rely on implicit join references you can disable the feature entirely by setting `config.active_record.disable_implicit_join_references = true`. (called from require at /home/lee/code/cassandra/bin/rails:4)
  10.   SQL (1.6ms)  SELECT "members"."id" AS t0_r0, "members"."survey_group_id" AS t0_r1, "members"."email" AS t0_r2, "members"."survey_token" AS t0_r3, "members"."created_at" AS t0_r4, "members"."updated_at" AS t0_r5, "members"."deleted_at" AS t0_r6, "responses"."id" AS t1_r0, "responses"."member_id" AS t1_r1, "responses"."question_id" AS t1_r2, "responses"."score" AS t1_r3, "responses"."created_at" AS t1_r4, "responses"."updated_at" AS t1_r5, "responses"."deleted_at" AS t1_r6 FROM "members" LEFT OUTER JOIN "responses" ON "responses"."member_id" = "members"."id" WHERE "members"."survey_group_id" = $1 AND (responses.id IS NOT NULL)  [["survey_group_id", 507]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement