module Lite::Form::Helpers::Persistence

Public Class Methods

included(klass) click to toggle source
# File lib/lite/form/helpers/persistence.rb, line 22
def included(klass)
  klass.extend(ClassMethods)
end

Public Instance Methods

create() click to toggle source
# File lib/lite/form/helpers/persistence.rb, line 32
def create
  raise Lite::Form::NotImplementedError unless defined?(create_action)
  return unless valid?

  run_callbacks(:create) { @result = create_action }
end
persisted?() click to toggle source
# File lib/lite/form/helpers/persistence.rb, line 28
def persisted?
  false
end
save() click to toggle source
# File lib/lite/form/helpers/persistence.rb, line 39
def save
  raise Lite::Form::NotImplementedError unless defined?(save_action)
  return unless valid?

  run_callbacks(:save) { @result = save_action }
end
update() click to toggle source
# File lib/lite/form/helpers/persistence.rb, line 46
def update
  raise Lite::Form::NotImplementedError unless defined?(update_action)
  return unless valid?

  run_callbacks(:update) { @result = update_action }
end