sorcery
sorcery copied to clipboard
Added support for `scope_for_authentication` method
Example:
class User < ApplicationRecord
authenticates_with_sorcery!
def self.scope_for_authentication
where(deleted: false)
end
end
Until this pull request is merged, there is a workaround:
config/initializers/sorcery.rb
Rails.application.config.sorcery.configure do |config|
# :
# :
config.user_class = 'ActiveUser'
# :
# :
end
app/models/active_user.rb
ActiveUser = User.where(deleted: false)