Class: Dscf::Credit::BankStaffCreationService
- Inherits:
-
Object
- Object
- Dscf::Credit::BankStaffCreationService
- Includes:
- ActiveModel::Attributes, ActiveModel::Model
- Defined in:
- app/services/dscf/credit/bank_staff_creation_service.rb
Instance Attribute Summary collapse
-
#bank_staff ⇒ Object
readonly
Returns the value of attribute bank_staff.
-
#generated_password ⇒ Object
readonly
Returns the value of attribute generated_password.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(attributes = {}) ⇒ BankStaffCreationService
constructor
A new instance of BankStaffCreationService.
Constructor Details
#initialize(attributes = {}) ⇒ BankStaffCreationService
Returns a new instance of BankStaffCreationService.
30 31 32 |
# File 'app/services/dscf/credit/bank_staff_creation_service.rb', line 30 def initialize(attributes = {}) super(attributes) end |
Instance Attribute Details
#bank_staff ⇒ Object (readonly)
Returns the value of attribute bank_staff.
28 29 30 |
# File 'app/services/dscf/credit/bank_staff_creation_service.rb', line 28 def bank_staff @bank_staff end |
#generated_password ⇒ Object (readonly)
Returns the value of attribute generated_password.
28 29 30 |
# File 'app/services/dscf/credit/bank_staff_creation_service.rb', line 28 def generated_password @generated_password end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
28 29 30 |
# File 'app/services/dscf/credit/bank_staff_creation_service.rb', line 28 def user @user end |
Instance Method Details
#call ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/services/dscf/credit/bank_staff_creation_service.rb', line 34 def call ActiveRecord::Base.transaction do create_user! assign_role! create_bank_staff! send_welcome_email! true rescue => e errors.add(:base, e.) false end end |