Class: DynamicActiveResource::Associations::HasMany

Inherits:
Base
  • Object
show all
Defined in:
lib/dynamic_active_resource/associations/has_many.rb

Instance Attribute Summary

Attributes inherited from Base

#method_name

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DynamicActiveResource::Associations::Base

Instance Method Details

#resources_for(caller) ⇒ Object



11
12
13
14
# File 'lib/dynamic_active_resource/associations/has_many.rb', line 11

def resources_for(caller)
  set_associated_class_attributes(caller)
  associated_class.find(:all)
end

#set_associated_class_attributes(caller) ⇒ Object



4
5
6
7
8
9
# File 'lib/dynamic_active_resource/associations/has_many.rb', line 4

def set_associated_class_attributes(caller)
  associated_class_site = File.join(caller.class.site.to_s, caller.class.collection_name, caller.resource_identifier)
  associated_class.site = associated_class_site
  associated_class.user = caller.class.user
  associated_class.password = caller.class.password
end