Class: Cuprum::Rails::Commands::BuildOne
- Inherits:
-
Cuprum::Rails::Command
- Object
- Collections::Command
- Cuprum::Rails::Command
- Cuprum::Rails::Commands::BuildOne
- Defined in:
- lib/cuprum/rails/commands/build_one.rb
Overview
Command for generating an ActiveRecord model from an attributes hash.
Instance Attribute Summary
Attributes inherited from Cuprum::Rails::Command
#collection_name, #member_name, #options, #record_class
Instance Method Summary collapse
-
#call(attributes: ) ⇒ ActiveRecord::Base
Builds a new record with the given attributes.
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: ) ⇒ ActiveRecord::Base
Builds a new record with the given attributes.
37 38 39 40 |
# File 'lib/cuprum/rails/commands/build_one.rb', line 37 validate_parameters :call do keyword :attributes, Stannum::Constraints::Types::HashWithIndifferentKeys.new end |