Class: DynamicActiveResource::Associations::BelongsTo

Inherits:
Base
  • Object
show all
Defined in:
lib/dynamic_active_resource/associations/belongs_to.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



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

def resources_for(caller)
  site_elements = caller.class.site.path.split('/')
  associated_resource_id = site_elements[-1]
  associated_class.find(associated_resource_id)
end