Class: ThumbleMonks::FromModelLoader

Inherits:
ModelLoader show all
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

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