Skip to content

External submodule broken with custom authentications relation name #580

Open
@arnvald

Description

@arnvald

We call this code:

current_user.send(config.authentications_class.name.underscore.pluralize)

when looking for user authentications. This works if the name of relation is just plural form of the class (Authentication -> user.authentications). Problem appears with following code:

#sorcery.rb
user.authentications_class = Authentication

#user.rb
has_many :providers, class_name: "Authentication"

I'm not sure what to do with this one, yet. Either add some information, that relation will not work properly with class_name option, or add another config option, that will describe relation name, but if not specified, will default to plural form of class name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions