Class: Cuprum::Rails::Commands::InsertOne
- Inherits:
-
Cuprum::Rails::Command
- Object
- Collections::Command
- Cuprum::Rails::Command
- Cuprum::Rails::Commands::InsertOne
- Defined in:
- lib/cuprum/rails/commands/insert_one.rb
Overview
Command for inserting an ActiveRecord record into the collection.
Instance Attribute Summary
Attributes inherited from Cuprum::Rails::Command
#collection_name, #member_name, #options, #record_class
Instance Method Summary collapse
-
#call(entity: ) ⇒ Cuprum::Result<ActiveRecord::Base>
Inserts the record into the collection.
Methods inherited from Cuprum::Rails::Command
#initialize, #primary_key_name, #primary_key_type, subclass
Constructor Details
This class inherits a constructor from Cuprum::Rails::Command
Instance Method Details
#call(entity: ) ⇒ Cuprum::Result<ActiveRecord::Base>
Inserts the record into the collection.
If the collection already includes a record with the same primary key, #call will fail and the collection will not be updated.
21 22 23 |
# File 'lib/cuprum/rails/commands/insert_one.rb', line 21 validate_parameters :call do keyword :entity, Object end |