Sha256: f22e74285af6b03ef68771989d3a2a74418d68acec9ca3218e4ca17dd3ce3f39

Contents?: true

Size: 420 Bytes

Versions: 76

Compression:

Stored size: 420 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

class LHS::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

76 entries across 76 versions & 1 rubygems

Version Path
lhs-22.1.1.pre lib/lhs/concerns/record/create.rb
lhs-22.1.0 lib/lhs/concerns/record/create.rb
lhs-22.0.0 lib/lhs/concerns/record/create.rb
lhs-21.3.1 lib/lhs/concerns/record/create.rb
lhs-21.3.0 lib/lhs/concerns/record/create.rb
lhs-21.3.0.pre.autoauth.1 lib/lhs/concerns/record/create.rb
lhs-21.2.4 lib/lhs/concerns/record/create.rb
lhs-21.2.3 lib/lhs/concerns/record/create.rb
lhs-21.2.3.pre.preload.pre.providers.pre.too.1 lib/lhs/concerns/record/create.rb
lhs-21.2.2 lib/lhs/concerns/record/create.rb
lhs-21.2.1 lib/lhs/concerns/record/create.rb
lhs-21.2.0 lib/lhs/concerns/record/create.rb
lhs-21.1.4 lib/lhs/concerns/record/create.rb
lhs-21.1.3 lib/lhs/concerns/record/create.rb
lhs-21.1.2 lib/lhs/concerns/record/create.rb
lhs-21.1.2.pre.keyfix.2 lib/lhs/concerns/record/create.rb
lhs-21.1.2.pre.keyfix.1 lib/lhs/concerns/record/create.rb
lhs-21.1.2.pre.fix.pre.cant.pre.add.pre.new.pre.key.pre.during.pre.iteration.1 lib/lhs/concerns/record/create.rb
lhs-21.1.1.pre.pre.fix.pre.cant.pre.add.pre.new.pre.key.pre.during.pre.iteration.1 lib/lhs/concerns/record/create.rb
lhs-21.1.0 lib/lhs/concerns/record/create.rb