Class: ErpUsers::CreateService
- Inherits:
-
Object
- Object
- ErpUsers::CreateService
- Defined in:
- app/services/erp_users/create_service.rb
Instance Attribute Summary collapse
-
#company_ids ⇒ Object
readonly
Returns the value of attribute company_ids.
-
#current_company ⇒ Object
readonly
Returns the value of attribute current_company.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#erp_user_params ⇒ Object
readonly
Returns the value of attribute erp_user_params.
-
#navigation_configuration ⇒ Object
readonly
Returns the value of attribute navigation_configuration.
-
#permission_group_ids ⇒ Object
readonly
Returns the value of attribute permission_group_ids.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(erp_user_params:, current_user:, current_company:, navigation_configuration_id:, company_ids:, permission_group_ids:) ⇒ CreateService
constructor
A new instance of CreateService.
Constructor Details
#initialize(erp_user_params:, current_user:, current_company:, navigation_configuration_id:, company_ids:, permission_group_ids:) ⇒ CreateService
Returns a new instance of CreateService.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/services/erp_users/create_service.rb', line 10 def initialize( erp_user_params:, current_user:, current_company:, navigation_configuration_id:, company_ids:, permission_group_ids: ) @erp_user_params = erp_user_params @current_user = current_user @current_company = current_company @navigation_configuration = @company_ids = company_ids @permission_group_ids = end |
Instance Attribute Details
#company_ids ⇒ Object (readonly)
Returns the value of attribute company_ids.
3 4 5 |
# File 'app/services/erp_users/create_service.rb', line 3 def company_ids @company_ids end |
#current_company ⇒ Object (readonly)
Returns the value of attribute current_company.
3 4 5 |
# File 'app/services/erp_users/create_service.rb', line 3 def current_company @current_company end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
3 4 5 |
# File 'app/services/erp_users/create_service.rb', line 3 def current_user @current_user end |
#erp_user_params ⇒ Object (readonly)
Returns the value of attribute erp_user_params.
3 4 5 |
# File 'app/services/erp_users/create_service.rb', line 3 def erp_user_params @erp_user_params end |
#navigation_configuration ⇒ Object (readonly)
Returns the value of attribute navigation_configuration.
3 4 5 |
# File 'app/services/erp_users/create_service.rb', line 3 def @navigation_configuration end |
#permission_group_ids ⇒ Object (readonly)
Returns the value of attribute permission_group_ids.
3 4 5 |
# File 'app/services/erp_users/create_service.rb', line 3 def @permission_group_ids end |
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/erp_users/create_service.rb', line 26 def call ActiveRecord::Base.transaction do create_record associate_companies validate_after_associations @erp_user end end |