J'ai un modèle Utilisateurs qui a besoin d'une :emailcolonne (j'ai oublié d'ajouter cette colonne lors de l'échafaudage initial).
J'ai ouvert le fichier de migration et ajouté t.string :email, fait rake db:migrateet obtenu un fichier NoMethodError. J'ai ensuite ajouté la ligne
add_column :users, :email, :string
encore rake db:migrate, encore NoMethodError. Suis-je en train de manquer une étape ici?
Edit: voici le fichier de migration.
class CreateUsers < ActiveRecord::Migration
def self.up
add_column :users, :email, :string
create_table :users do |t|
t.string :username
t.string :email
t.string :crypted_password
t.string :password_salt
t.string :persistence_token
t.timestamps
end
end
def self.down
drop_table :users
end
end
add_email_to_userset NONadd_email_to_user?