Sha256: e6e1e8535592175546e1c69a12c37fa8e31e9461fca6acdaea04df6744ff516e

Contents?: true

Size: 389 Bytes

Versions: 139

Compression:

Stored size: 389 Bytes

Contents

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

139 entries across 139 versions & 1 rubygems

Version Path
lhs-16.1.5 lib/lhs/concerns/record/create.rb
lhs-16.1.4 lib/lhs/concerns/record/create.rb
lhs-16.1.3 lib/lhs/concerns/record/create.rb
lhs-16.1.2 lib/lhs/concerns/record/create.rb
lhs-16.1.1 lib/lhs/concerns/record/create.rb
lhs-16.1.0 lib/lhs/concerns/record/create.rb
lhs-16.0.1 lib/lhs/concerns/record/create.rb
lhs-16.0.0 lib/lhs/concerns/record/create.rb
lhs-15.7.0 lib/lhs/concerns/record/create.rb
lhs-15.6.1 lib/lhs/concerns/record/create.rb
lhs-15.6.0 lib/lhs/concerns/record/create.rb
lhs-15.5.1 lib/lhs/concerns/record/create.rb
lhs-15.5.0 lib/lhs/concerns/record/create.rb
lhs-15.4.1 lib/lhs/concerns/record/create.rb
lhs-15.4.0 lib/lhs/concerns/record/create.rb
lhs-15.4.0.pre.hasone.1 lib/lhs/concerns/record/create.rb
lhs-15.3.3 lib/lhs/concerns/record/create.rb
lhs-15.3.3.pre.fixoptions.1 lib/lhs/concerns/record/create.rb
lhs-15.3.2 lib/lhs/concerns/record/create.rb
lhs-15.3.1 lib/lhs/concerns/record/create.rb