ruby on rails - NoMethodError: undefined method reset_sent_at hartle tutorial -
i'm doing chapter 10 of enter link description here. got same error mentioned in enter link description here
passwordresetstest#test_password_resets: nomethoderror: undefined method `reset_sent_at=' #<user:0xccd47c0> app/models/user.rb:66:in `create_reset_digest' app/controllers/password_resets_controller.rb:12:in `create' test/integration/password_resets_test.rb:17:in `block in <class:passwordresetstest>'
i try mentioned in answer. first thing did was:
rails generate migration add_reset_to_users reset_digest:string reset_sent_at:datetime
and answer was:
another migration named add_reset_to_users:
so i'm sure did migration before. _add_reset_to_users.rb file in migrate folder.
class addresettousers < activerecord::migration def change add_column :users, :reset_digest, :string end end
then try restart rails server.(i'm not sure if i'm doing right) using
rails server
and shutting down server. non of them worked. i'm still getting same error.
another migration named add_reset_to_users:
you had created migration previously, noted, migration did not include addition of reset_sent_at
column.
at point easiest thing create new migration add missing column.
rails generate migration add_reset_sent_at_to_users reset_sent_at:datetime
Comments
Post a Comment