Sha256: 8d92abe64946bc4f3d72a238b2ba01343b7fcb9f0836e5a863c8bb0b677b12b1

Contents?: true

Size: 420 Bytes

Versions: 12

Compression:

Stored size: 420 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

class DHS::Record

  module Create
    extend ActiveSupport::Concern

    module ClassMethods
      def create(data = {}, options = nil)
        record = new(data)
        record.save(options)
        record
      end

      def create!(data = {}, options = nil)
        record = new(data)
        record.save!(options)
        record
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 lib/dhs/concerns/record/create.rb
dhs-1.5.0 lib/dhs/concerns/record/create.rb
dhs-1.4.2 lib/dhs/concerns/record/create.rb
dhs-1.4.1 lib/dhs/concerns/record/create.rb
dhs-1.4.0 lib/dhs/concerns/record/create.rb
dhs-1.3.0 lib/dhs/concerns/record/create.rb
dhs-1.2.0 lib/dhs/concerns/record/create.rb
dhs-1.1.0 lib/dhs/concerns/record/create.rb
dhs-1.0.3 lib/dhs/concerns/record/create.rb
dhs-1.0.2 lib/dhs/concerns/record/create.rb
dhs-1.0.1 lib/dhs/concerns/record/create.rb
dhs-1.0.0 lib/dhs/concerns/record/create.rb