Forum: Ruby on Rails Four Days with Rails Issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
66ca686a219cd292c0e4b8db3ea230bd?d=identicon&s=25 Mohit Sindhwani (Guest)
on 2006-06-07 12:46
(Received via mailing list)
Hi, I'm trying to get through the popular "Four Days with Rails"
tutorial and am experiencing some problem with the "Priority" of the
item.  Right from the start, RoR seems to want to consider it as a value
that must be boolean.  The scaffolded code asks for "True/ False" as the
input.

PHPMyAdmin shows that the database thinks it should be an unsigned
TinyInt with a default value of 3.  But, RoR seems to be confused about
it.  As a result, the validation fails (cos it seems to be checking for
a "true/ false" value :in=>1..5 and does not succeed).  I finally
removed the validation since it was failing and tried again.  It now
adds a record with Priority = "true".

Any idea what I should look for?  Sorry if more information is needed -
just ask :)

Thanks
Mohit.
66ca686a219cd292c0e4b8db3ea230bd?d=identicon&s=25 Mohit Sindhwani (Guest)
on 2006-06-07 12:59
(Received via mailing list)
Mohit Sindhwani wrote:
> finally removed the validation since it was failing and tried again.
> It now adds a record with Priority = "true".
>
> Any idea what I should look for?  Sorry if more information is needed
> - just ask :)
>
> Thanks
> Mohit.
>

OK, it's probably bad manners to reply to my own mail! :)
But, I just changed the database structure for the item to hold the
priority in a "SmallInt" instead of a "TinyInt" and everything seems to
be fine and works OK.  RoR scaffold code works fine (almost.. it now has
a problem with validating the Done field) but the priority is fine.  The
modified part (code modified after the scaffold was generated) works
perfectly.

But, can anyone clarify my understanding that RoR seems to think that a
TinyInt is a boolean value?

Cheers
Mohit.

p.s. Sorry that I did a reply to my mail rather than to the list - my
server (or the list server) seems to be facing a problem and I'm
receiving emails from 12 hours back only now!
p.p.s Apologies also for the reply that I sent right now to an email
from about 12 hours back - perhaps, someone had already responded :P
This topic is locked and can not be replied to.