Module: LHS::Proxy::Create

Extended by:
ActiveSupport::Concern
Included in:
LHS::Proxy
Defined in:
lib/lhs/concerns/proxy/create.rb

Instance Method Summary collapse

Instance Method Details

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


10
11
12
13
14
15
16
17
# File 'lib/lhs/concerns/proxy/create.rb', line 10

def create(data = {}, options = nil)
  record_creation!(options) do
    record_from_link.create(
      data,
      options_for_creation(options)
    )
  end
end

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


19
20
21
22
23
24
25
26
# File 'lib/lhs/concerns/proxy/create.rb', line 19

def create!(data = {}, options = nil)
  record_creation!(options) do
    record_from_link.create!(
      data,
      options_for_creation(options)
    )
  end
end