Class: ExternalAuthentication
- Inherits:
-
Object
- Object
- ExternalAuthentication
- Defined in:
- lib/generators/monban/templates/app/services/external_authentication.rb
Instance Method Summary collapse
-
#initialize(auth_hash) ⇒ ExternalAuthentication
constructor
A new instance of ExternalAuthentication.
- #perform ⇒ Object
Constructor Details
#initialize(auth_hash) ⇒ ExternalAuthentication
Returns a new instance of ExternalAuthentication.
2 3 4 |
# File 'lib/generators/monban/templates/app/services/external_authentication.rb', line 2 def initialize(auth_hash) @auth_hash = auth_hash end |
Instance Method Details
#perform ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/generators/monban/templates/app/services/external_authentication.rb', line 6 def perform if scope.exists? scope.first else transaction { scope.create(user: user) } end end |