Class: ApplicationAction
- Inherits:
-
Object
- Object
- ApplicationAction
- Includes:
- ActiveModel::Model
- Defined in:
- lib/application_action.rb,
lib/application_action/version.rb
Constant Summary collapse
- VERSION =
'1.0.0'
Instance Method Summary collapse
Instance Method Details
#after_run ⇒ Object
22 |
# File 'lib/application_action.rb', line 22 def after_run; end |
#run ⇒ Object
18 19 20 |
# File 'lib/application_action.rb', line 18 def run raise 'You should write your own #run method' end |
#save ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/application_action.rb', line 4 def save return false unless valid? ApplicationRecord.transaction { run } after_run return true end |
#save! ⇒ Object
14 15 16 |
# File 'lib/application_action.rb', line 14 def save! raise errors..join(', ') unless save end |