Module: SkinnyControllers::Diet
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/skinny_controllers/diet.rb
Instance Method Summary collapse
-
#model ⇒ ActiveRecord::Base
abstraction for
operation.runuseful when there is no logic needed for deciding what to do with an operation or if there is no logic to decide which operation to use. -
#operation ⇒ Object
TODO: what if we want multiple operations per action?.
-
#operation_class ⇒ Class
Assumes the operation name from the controller name.
Instance Method Details
#model ⇒ ActiveRecord::Base
abstraction for operation.run useful when there is no logic needed for deciding what to do with an operation or if there is no logic to decide which operation to use
36 37 38 |
# File 'lib/skinny_controllers/diet.rb', line 36 def model @model ||= operation.run end |
#operation ⇒ Object
TODO: what if we want multiple operations per action?
15 16 17 18 19 20 |
# File 'lib/skinny_controllers/diet.rb', line 15 def operation @operation ||= operation_class.new( current_user, params, params_for_action, action_name, self.class.model_key) end |
#operation_class ⇒ Class
Assumes the operation name from the controller name
26 27 28 |
# File 'lib/skinny_controllers/diet.rb', line 26 def operation_class Lookup::Operation.from_controller(self.class.name, verb_for_action, self.class.model_class) end |