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.

Regexp expressions ignored

#98

Regular expression options (i for ignore case and so on) are ignored:

Party.select {|p| p.display_name =~ /beausoleil/i}.to_sql

Returns the following:

"SELECT * FROM parties WHERE parties.`display_name` REGEXP 'beausoleili'"

Note the extra 'i' at the end of the name.

Reported by François Beausoleil · August 30th, 2007 @ 08:09 AM

State: new
Milestone: none
Assigned to: Chris Wanstrath Chris Wanstrath

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • State changed from new to resolved

    Does SQL accept flags? For now I'm just removing the flags.

    Fixed in http://projects.require.errthebl... and in just-pushed gem 0.1.4

    August 30th, 2007 @ 11:17 AM

  2. Matthew King
    Matthew King

    postgres has different regexp operators for case sensitive and case insensitive. Perhaps the flags could be tracked for use in adapter-specific regexes.

    http://www.postgresql.org/docs/8.2/static/functions-matching.html#FUNCTIONS-POSIX-TABLE

    August 31st, 2007 @ 07:45 AM

  3. Chris Wanstrath
    Chris Wanstrath

    I added support for case insensitive / sensitive postgres operators.

    http://projects.require.errthebl...

    September 2nd, 2007 @ 12:39 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.