Skip to content

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

@matjemeisje

Description

@matjemeisje

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions