On Sep 16, 11:49 am, merbivore <[email protected]> wrote:
> Hi All,
>
>     I have a quick question related to activerecord exist. Can we do a
> activerecord object exist method with a date field.
> Like
>
>   Weather.exists?(:weather_date => 22/09/11 )
>
> Can we do like above. Please clarify me.

Yes (you should use a date object or a string containing a date in a
format the database will understand) The only caveat is that if the
column is actually a datetime column then you need to check for the
range of datetimes that make up that particular day)

Fred

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to