Class: Cuprum::Rails::Commands::AssignOne
- Inherits:
-
Cuprum::Rails::Command
- Object
- Collections::Command
- Cuprum::Rails::Command
- Cuprum::Rails::Commands::AssignOne
- Defined in:
- lib/cuprum/rails/commands/assign_one.rb
Overview
Command for assigning attributes to an ActiveRecord model.
Instance Attribute Summary
Attributes inherited from Cuprum::Rails::Command
#collection_name, #member_name, #options, #record_class
Instance Method Summary collapse
-
#call(attributes: , entity: ) ⇒ ActiveRecord::Base
Assigns the given attributes to the record.
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(attributes: , entity: ) ⇒ ActiveRecord::Base
Assigns the given attributes to the record.
Any attributes on the record that are not part of the given attributes hash are unchanged.
43 44 45 46 47 |
# File 'lib/cuprum/rails/commands/assign_one.rb', line 43 validate_parameters :call do keyword :attributes, Stannum::Constraints::Types::HashWithIndifferentKeys.new keyword :entity, Object end |