Class: ApiMaker::CreateCommandService
- Inherits:
-
CommandService
- Object
- ServicePattern::Service
- ApplicationService
- CommandService
- ApiMaker::CreateCommandService
- Defined in:
- app/services/api_maker/create_command_service.rb
Instance Attribute Summary
Attributes inherited from CommandService
#ability, #api_maker_args, #command_name, #command_response, #commands, #controller, #resource_name
Instance Method Summary collapse
Methods inherited from CommandService
#initialize, #model_class, #namespace, #resource
Methods inherited from ApplicationService
Constructor Details
This class inherits a constructor from ApiMaker::CommandService
Instance Method Details
#collection ⇒ Object
15 16 17 |
# File 'app/services/api_maker/create_command_service.rb', line 15 def collection @collection ||= model_class.accessible_by(@ability, :create) end |
#perform ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'app/services/api_maker/create_command_service.rb', line 2 def perform ApiMaker::CreateCommand.execute_in_thread!( ability: ability, api_maker_args: api_maker_args, collection: collection, commands: commands, command_response: command_response, controller: controller ) succeed! end |