Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

AREL is building incorrect conditions when line-breaks are included

#5456

I have the following problem with ActiveRecord 3.0.0.RC2:

  > Account.where(:name => "some\nname").to_sql
  => "SELECT     \"accounts\".* FROM       \"accounts\"  WHERE     (\"accounts\".\"name\" = 'some\n AND name')"

But - of course - it should be:

  => "SELECT     \"accounts\".* FROM       \"accounts\"  WHERE     (\"accounts\".\"name\" = 'some\nname')"

I tried to trace the problem but couldn't find it. Individual to_sql calls seem to be doing the right thing (see below):

  > Account.where(:name => "some\nname").where_values.first.to_sql
  => "\"accounts\".\"name\" = 'some\nname'"

Reported by Dim · August 25th, 2010 @ 05:51 PM

State: duplicate
Milestone: none
Assigned to: nobody
Importance: Low