Hey,

I was on a project that was supporting mysql (local build machine), sqlite3 
(developer's box), and posgres (heroku)

the boolean instances were very tricky across these.
Date logic is also a pain ( e.g. time = NOW() )


I ended up implementing a hack on top of active_record connection, that worked, 
but I wasn't too happy.
If someone has a better solution - please share.

--Keenan

http://gist.github.com/440903





On Jun 16, 2010, at 10:22 AM, Steve Smith wrote:

> Looks like Arel might not be escaping the true correctly which is strange. 
> How about 
> 
> p = Project.where(["status = ?", true])
> 
> Does that do the same thing?
> Steve
> 
> 
> On 16 Jun 2010, at 14:46, webdevotion wrote:
> 
>> Hey
>> 
>> We have a problem with our Projects controller.
>> Where we want to select all  the projects with status set to true we
>> use:
>> 
>> p = Project.where(:status => true)
>> 
>> It works locally, but it doesn't work on the Heroku instance.
>> 
>> Does work, but not agnostic
>> p = Project.where(:status => '1')
>> 
>> What's the best practice to solve this ( little ) problem?
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Heroku" 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/heroku?hl=en.
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Heroku" 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/heroku?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" 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/heroku?hl=en.

Reply via email to