Module: LHS::Record::Create::ClassMethods

Defined in:
lib/lhs/concerns/record/create.rb

Instance Method Summary collapse

Instance Method Details

#create(data = {}, options = nil) ⇒ Object



9
10
11
12
13
# File 'lib/lhs/concerns/record/create.rb', line 9

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

#create!(data = {}, options = nil) ⇒ Object



15
16
17
18
19
# File 'lib/lhs/concerns/record/create.rb', line 15

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