Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to delete users due to missing foreign key for all_comments association in UserMethods #941

Open
matjemeisje opened this issue Feb 28, 2020 · 0 comments

Comments

@matjemeisje
Copy link

I am using a custom user model as per your directions on how to implement devise with camaleon. When I try to delete a user from the admin panel, it fails because it cannot find the user column in the comments table. Inspection of the code shows that the foreign key specification is missing from the association on line 18 of CamaleonCms::UserMethods:

has_many :all_comments, class_name: 'CamaleonCms::PostComment'

Should be:

has_many :all_comments, class_name: 'CamaleonCms::PostComment', foreign_key: :user_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant