Monday, October 4, 2010

[Rails] Re: How to write an ActiveRecord conditions containing null?

> > This should be so easy to implement that I am not sure why it has not
> > already been done.
>
> Interesting question.  I've never needed this except as part of complex
> queries where I'm already writing SQL anyway, but YMMV.

It occurred to me while working on my very first RoR gig. I
'inherited' a DB with a column for the status of the record where NULL
and the empty value 'meant' the same thing and an asterisk (*) meant
that the record was 'soft-deleted'. I ended up writing a lot of
functionality just to get the correct records. It didn't help that I
didn't know that much RoR at the time. Not that I know much more
now... However I could see that the problem I was facing should be
pretty common and was hoping to find an ActiveRecord solution, but I
never did find it.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate