lib/arcade/base.rb
def  create **attributes
        Api.begin_transaction db.database
        attributes.merge!( created: DateTime.now ) if timestamps
        record = insert **attributes
        Api.commit db.database
        record
      rescue RuntimeError => e
        db.logger.error "Dataset NOT created"
        db.logger.error "Provided Attributes: #{attributes.inspect}"
        Api.rollback db.database
      rescue  Dry::Struct::Error => e
        Api.rollback db.database
        db.logger.error "#{rid} :: Validation failed, record deleted."
        db.logger.error e.message
      end
## ----------------------------------------- create       ---------------------------------- ##
#
#  Adds a record to the database
#
#  returns the model dataset
#  ( depreciated )
create
Adds a record to the database

returns the model dataset
( depreciated )
create Adds a record to the database returns the model dataset ( depreciated )
def  create **attributes
        Api.begin_transaction db.database
        attributes.merge!( created: DateTime.now ) if timestamps
        record = insert **attributes
        Api.commit db.database
        record
      rescue RuntimeError => e
        db.logger.error "Dataset NOT created"
        db.logger.error "Provided Attributes: #{attributes.inspect}"
        Api.rollback db.database
      rescue  Dry::Struct::Error => e
        Api.rollback db.database
        db.logger.error "#{rid} :: Validation failed, record deleted."
        db.logger.error e.message
      end
def create ** attributes Api . begin_transaction db . database attributes . merge! ( created : DateTime . now ) if timestamps record = insert ** attributes Api . commit db . database record rescue RuntimeError => e db . logger . error "Dataset NOT created" db . logger . error "Provided Attributes: #{attributes.inspect}" Api . rollback db . database rescue Dry :: Struct :: Error => e Api . rollback db . database db . logger . error "#{rid} :: Validation failed, record deleted." db . logger . error e . message end
create       
Adds a record to the database
create Adds a record to the database
attributes