module ActiveRecord::Persistence::ClassMethods
def create!(attributes = nil, &block)
These describe which attributes to be created on the object, or
The +attributes+ parameter can be either a Hash or an Array of Hashes.
unlike Base#create.
if validations pass. Raises a RecordInvalid error if validations fail,
Creates an object (or multiple objects) and saves it to the database,
def create!(attributes = nil, &block) if attributes.is_a?(Array) attributes.collect { |attr| create!(attr, &block) } else object = new(attributes, &block) object.save! object end end