On Oct 7, 10:42 am, Christer Nilsson <[email protected]>
wrote:
> I expected the sql statement:
>
> SELECT * FROM Item WHERE startDate <= '2009-09-09'
>
> by using:
>
> Item.filter(:startDate <= '2009-09-09')
>
> startDate is declared varchar(20) (legacy stuff)
>
> but got the error
>
> `<=': comparison of String with :startDate failed (ArgumentError)
>
> Is it not possible to compare strings in Sequel?
I'll take a wild guess that you are using ruby 1.9, which defines
Symbol#<=. Sequel doesn't override methods defined by ruby, so you
can't use that syntax on 1.9. You can do one of the following:
Item.filter{startDate <= '2009-09-09'}
Item.filter(:startDate.sql_string <= '2009-09-09')
Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---