Method: ActiveData::Model::Lifecycle::ClassMethods#create!
- Defined in:
- lib/active_data/model/lifecycle.rb
#create!(*args) ⇒ Object
Initializes new instance with attributes passed and calls save! on it. Returns instance in case of success and raises ActiveData::ValidationError or ActiveData::ObjectNotSaved in case of validation or saving fail respectively.
128 129 130 |
# File 'lib/active_data/model/lifecycle.rb', line 128 def create! *args new(*args).tap(&:save!) end |