Module: Cequel::Record::Validations::ClassMethods

Defined in:
lib/cequel/record/validations.rb

Overview

Validation-related methods exposed on Record class singletons

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#create!(attributes = {}) {|record| ... } ⇒ Record

Attempt to create a new record, or raise an exception otherwise

Parameters:

  • attributes (Hash) (defaults to: {})

    attributes to assign to the new record

Yield Parameters:

  • record (Record)

    record to make modifications before saving

Returns:

Raises:

Since:

  • 0.1.0



44
45
46
# File 'lib/cequel/record/validations.rb', line 44

def create!(attributes = {}, &block)
  new(attributes, &block).save!
end