Yelpdemo: Link Reviews to Users Issue

Now that I have linked my Reviews to Users, when I try to sign into my account it won't let me. This is the error that comes up on my web browser undefined method `current_sign_in_at' for #<User:0x00007fdfaebc28f8> else match = matched_attribute_method(method.to_s) match ? attribute_missing(match, *args, &block) : super end end Not sure where to find this or how to fix it, HELP! Thanks!

Posted 9 months ago by Katherine Ferriss
Posted 30 days ago by Paul Tammaro

I have the same issue

1
Posted 30 days ago by Paul Tammaro

Yelpdemo: Link Reviews to Users Issue
Now that I have linked my Reviews to Users, when I try to sign into my account it won't let me. This is the error that comes up on my web browser undefined method `current_sign_in_at' for #<User:0x00007fdfaebc28f8> else match = matched_attribute_method(method.to_s) match ? attribute_missing(match, *args, &block) : super end end Not sure where to find this or how to fix it, HELP! Thanks!
Posted 8 months ago by Katherine Ferriss

I have same issue

1
Posted 27 days ago by Alex Yang

Hi Paul, based on the information you've given me, it sounds like you may have a data migration issue. Here's what I suspect is happening. You had created some existing Reviews prior to linking Reviews to Users. As a consequence, any new Reviews you create will be linked to a specific User, but the legacy ones that were created earlier are unassigned to any User. So for example, if you were to write some code to display the name of the reviewer on the page, your app would find the Review, look for the User who created it, come up empty, and return an error.

To fix the issue, you have two approaches: either update all the legacy Reviews with an assigned User (using either the rails console or a tool like DB Browser for SQLite) or delete all legacy (or just all) Reviews. I'm assuming you have a pretty minimal database at this point, so if you want to delete all Reviews, you could open 'rails console' and run 'Review.destroy_all'.

Let me know if you need any more help!

1