On 19 November 2013 18:36, rusik <[email protected]> wrote:
> yes, it is string. I find decision , i am using date without zero's like
> this:

Just to convince us show us the users table entry from db/schema.rb.

Colin

> User.where(bdate: "1945-5-9")
> вторник, 19 ноября 2013 г., 19:09:01 UTC+4 пользователь Colin Law написал:
>>
>> On 19 November 2013 14:07, rusik <[email protected]> wrote:
>> > Hi all, i have User model with bdate: string
>> > Try :
>> >>
>> >> User.find(2).bdate
>> >> => Wed, 09 May 1945
>> >> User.find(2).bdate.to_s
>> >> => "1945-05-09"
>>
>> Are you sure bdate is of type string in the database?  If so then why
>> does it appear to interpret it as a date in your first example?
>>
>> Colin
>>
>> >
>> > But if i run:
>> >>
>> >> User.where(bdate: "1945-05-09")
>> >> => []
>> >
>> > Why???
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Ruby on Rails: Talk" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to [email protected].
>> > To post to this group, send email to [email protected].
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/rubyonrails-talk/2989915a-d24e-491f-87e2-efb061910ff2%40googlegroups.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv0HsuPaOkEwyGAELtnw8y4yYbAmTFfhoRvLOKVGaAP7A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to