Is there a way to do enumerations in migrations?
I.E. color(red, black, blue, green, etc)
Is there a way to do enumerations in migrations?
I.E. color(red, black, blue, green, etc)
Dustin wrote:
Is there a way to do enumerations in migrations?
I.E. color(red, black, blue, green, etc)
take a look at the "enum-column" plugin
http://rubyforge.org/projects/enum-column/ http://wiki.rubyonrails.com/rails/pages/Enum+Column+in+MySql
think this is what I used before, and there was an update in January 2008, so hopefully it still works with Rails2.
eg. t.column :color, :enum, :limit => [:red, :blue, :green, :yellow]
don't know if it'll support sexy migrations
t.enum :color, :limit => [:red, :blue, :green, :yellow]
I tried using the sexy migrations and it didn't seem to work. Is there something I need to install before using this?