1

I implemented multiple users with devise, following steps of this link

I generate models per type of user and extends from Users Model. Then, I add a column named type with string datatype to the user table in the database using a migration.

But, when I login with whatever user I get the following error:

ActiveRecord::StatementInvalid in Devise::SessionsController#create
Mysql2::Error: Unknown column 'type' in 'field list': UPDATE `users` SET `last_sign_in_at` = '2015-05-16 15:51:00', `current_sign_in_at` = '2015-05-26 22:49:23', `sign_in_count` = 10, `updated_at` = '2015-05-26 22:49:23' WHERE `users`.`id` = 1

Thanks for your advice! Sorry for my english.

Community
  • 1
  • 1
Dvex
  • 921
  • 2
  • 11
  • 35

1 Answers1

1

Run:

rails g migration add_type_to_users type:string

then:

bundle exec rake db:migrate
Papaya Labs
  • 1,079
  • 9
  • 11