Class: ThumbleMonks::ThroughModelLoader

Inherits:
AssociativeModelLoader show all
Defined in:
lib/thumblemonks/model_loader.rb

Overview

AssociativeModelLoader

Instance Attribute Summary

Attributes inherited from AssociativeModelLoader

#foreign_key, #load_through, #parameter_key

Attributes inherited from ModelLoader

#assigns_to, #except, #only, #requires

Instance Method Summary collapse

Methods inherited from AssociativeModelLoader

#load_model

Methods inherited from ModelLoader

#action_allowed?, #action_required?, #load_model

Constructor Details

#initialize(name, opts = {}) ⇒ ThroughModelLoader

:nodoc



67
68
69
70
71
# File 'lib/thumblemonks/model_loader.rb', line 67

def initialize(name, opts={})
  super
  @load_through = "@#{opts[:through]}".to_sym
  @association = opts[:association] || name.to_s.pluralize
end