0

Have two role permissions setup on registration: applicant and company. The account is deleting from the records in the terminal but is receiving a "Completed 500 Internal Server Error." This is occurring in development mode.

Using Devise for authentication and when going to cancel an account after logging in, the following error message below is presented. Error message receiving

User Model Method for Subscriptions

def subscribed?
  subscriptions.where(status: 'active').any?
end

Would like to fully understand why the above error is occurring and how to resolve it.

Ken
  • 17
  • 5
  • 1
    The flagged call to `super` looks for a same-named method as that call comes from. – radarbob May 19 '22 at 19:47
  • Are you sure that's the line that throws the error? – Joel Blum May 19 '22 at 21:13
  • @JoelBlum wasn't certain if it was coming from the user model missing an action on the association. The "undefined method 'active' for..." error message is what led me to figure it was the "subscribed?" method listed above. I can paste my model if needed – Ken May 19 '22 at 21:36

2 Answers2

0

I would look into This answer here. I was dealing with the same issue the other day, and the fix for me happened to me just over-defining things in my controller.. Kinda as if you defined subscriptions more than you need to.

The answer I linked was what I looked at when I ran into it, so thought maybe one could work. Not sure if either help, but hope it leads you on the right direction!

Jack
  • 27
  • 1
  • 7
0

Updated the column type from string to integer on the subscriptions table. Then added enum for status method inside the subscriptions model.

Ken
  • 17
  • 5