In my seeds.rb file I have:
user = User.new(
:user_type => UserTypes.MEMBER
)
I get an error:
rake aborted!
Expected /..../lib/user_types.rb to define UserTypes
module SomeName
class UserTypes
MEMBER = 1,
BLAHBALH = 2
end
end
Do I need an include or require at the top of the file?
Not an
include, you need the full classname (incl. modules). You might also need to move the file tolib/some_name/user_types.rb(this you can avoid by using an explicitrequire).