app/routines/openstax/accounts/dev/create_account.rb in openstax_accounts-7.2.0 vs app/routines/openstax/accounts/dev/create_account.rb in openstax_accounts-7.3.0
- old
+ new
@@ -4,18 +4,18 @@
module OpenStax
module Accounts
module Dev
class CreateAccount
lev_routine
-
+
protected
def exec(inputs={})
- fatal_error(:code => :cannot_create_account_in_production) if Rails.env.production?
- fatal_error(:code => :can_only_create_account_when_stubbing) if !OpenStax::Accounts.configuration.enable_stubbing?
+ fatal_error(code: :cannot_create_account_in_production) if Rails.env.production?
+ fatal_error(code: :can_only_create_account_when_stubbing) if !OpenStax::Accounts.configuration.enable_stubbing?
username = inputs[:username]
- while username.nil? || Account.where(username: username).exists? do
+ while username.nil? || Account.where(username: username).exists? do
username = SecureRandom.hex(3).to_s
end
account = OpenStax::Accounts::Account.new