Search code examples
ruby-on-railsrubyassociations

Receiving NoMethod association error when canceling an account in Ruby


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.


Solution

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