I'm just starting with Rails and decided to make a small app to learn with something practical.
I have a user class which has a user group integer field. I want to add to the migration a :default value using a constant.
In my user model I defined the different groups with constants so that I can later easily check "admin?" etc.
t.integer :user_group, :default => USER
I get the following error on db:migrate
rake aborted! Expected [...]/app/models/user.rb to define USER
However in the user model I have this:
ADMIN = 1
USER = 2
Any ideas what I'm doing wrong?