Class: ThumbleMonks::FromModelLoader
- Inherits:
-
ModelLoader
- Object
- ModelLoader
- ThumbleMonks::FromModelLoader
- Defined in:
- lib/thumblemonks/model_loader.rb
Overview
ThroughModelLoader
Instance Attribute Summary
Attributes inherited from ModelLoader
#assigns_to, #except, #only, #requires
Instance Method Summary collapse
-
#initialize(name, opts = {}) ⇒ FromModelLoader
constructor
:nodoc.
- #load_model(controller) ⇒ Object
Methods inherited from ModelLoader
#action_allowed?, #action_required?
Constructor Details
#initialize(name, opts = {}) ⇒ FromModelLoader
:nodoc
79 80 81 82 83 |
# File 'lib/thumblemonks/model_loader.rb', line 79 def initialize(name, opts={}) super @load_from = "@#{opts[:from]}".to_sym @association = name.to_s end |
Instance Method Details
#load_model(controller) ⇒ Object
85 86 87 |
# File 'lib/thumblemonks/model_loader.rb', line 85 def load_model(controller) retrieve_association_through(controller, @load_from) end |