Class: OpenStax::Accounts::FindOrCreateFromSso
- Inherits:
-
Object
- Object
- OpenStax::Accounts::FindOrCreateFromSso
- Defined in:
- app/routines/openstax/accounts/find_or_create_from_sso.rb
Instance Method Summary collapse
Instance Method Details
#exec(attrs) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/routines/openstax/accounts/find_or_create_from_sso.rb', line 6 def exec(attrs) attrs.stringify_keys! uid = attrs.delete('id') uuid = attrs.delete('uuid') account = Account.find_or_initialize_by(uuid: uuid) account.update!(attrs.slice(*Account.column_names)) transfer_errors_from(account, {type: :verbatim}) outputs.account = account end |