Forum: Ruby on Rails Enum

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.
zbyte pepsi-hola (Guest)
on 2006-01-28 06:20
(Received via mailing list)
When I do scaffold generated code for a table that has "enum" in it and
i
goto to the "new" button, no options are given. Anyway i could automate
it
so i can get a drop down box when using enums?
zbyte pepsi-hola (Guest)
on 2006-01-28 06:41
(Received via mailing list)
OK, let me restate this, i looked at the wiki but it seems cumbersome,
isn't
there a helper or plugin, or something to reduce code redundancy when
doing
enums?
Jonathan V. (Guest)
on 2006-01-30 14:56
I *think* mysql is really the only db that supports enums, that's
probably why rails doesn't bother with them.

Personally, I don't think enums should be used, because my opinion is
that the data validation should be done at a higher level (in this case
ActiveRecord).

So just use a varchar in your table and use validates_inclusion_of in
your model.

-Jonny.

zbyte pepsi-hola wrote:
> OK, let me restate this, i looked at the wiki but it seems cumbersome,
> isn't
> there a helper or plugin, or something to reduce code redundancy when
> doing
> enums?
This topic is locked and can not be replied to.