0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

deviceでdefault_scopeを外す

Last updated at Posted at 2020-12-22

対象のmodelでoverrideする
grepすると他にも気になる箇所は他にもあるけど、メール認証してない場合、取り敢えずこれで行けました
詳細は参考の一つ目が詳しいので参照ください

  class << self
    def serialize_from_session(key, salt)
      record = to_adapter.klass.unscoped.find(key[0])
      record if record && record.authenticatable_salt == salt
    end

    def find_first_by_auth_conditions(tainted_conditions, opts = {}) 
      to_adapter.klass.unscoped.where(devise_parameter_filter.filter(tainted_conditions).merge(opts)).first
    end
  end

参考
https://ja.ojit.com/so/ruby-on-rails/1631741
https://qiita.com/irisAsh/items/513b8b58f54421b9a1a0
https://qiita.com/shizuma/items/c8c2e71af8c1dcf3d1c2

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?