Module: Lite::Form::Helpers::Persistence
- Included in:
- Base
- Defined in:
- lib/lite/form/helpers/persistence.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
22 23 24 |
# File 'lib/lite/form/helpers/persistence.rb', line 22 def included(klass) klass.extend(ClassMethods) end |
Instance Method Details
#create ⇒ Object
32 33 34 35 36 37 |
# 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? ⇒ Boolean
28 29 30 |
# File 'lib/lite/form/helpers/persistence.rb', line 28 def persisted? false end |
#save ⇒ Object
39 40 41 42 43 44 |
# 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 ⇒ Object
46 47 48 49 50 51 |
# 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 |