Class: RestPack::Service::Commands::Create
- Inherits:
-
RestPack::Service::Command
- Object
- Mutations::Command
- RestPack::Service::Command
- RestPack::Service::Commands::Create
- Defined in:
- lib/restpack_service/commands/create.rb
Instance Attribute Summary
Attributes inherited from RestPack::Service::Command
Instance Method Summary collapse
Methods inherited from RestPack::Service::Command
#Model, #Serializer, #field_error, inherited, #init, #run, #service_error, #status, #valid?
Instance Method Details
#execute ⇒ Object
5 6 7 8 |
# File 'lib/restpack_service/commands/create.rb', line 5 def execute models = self.class.model_class.create!(inputs[self.class.serializer_class.key]) self.class.serializer_class.serialize models end |