Sha256: d534df5b25724517342e0a0fd92428f563721240687a7f0b85d504e999cc3f3d

Contents?: true

Size: 374 Bytes

Versions: 33

Compression:

Stored size: 374 Bytes

Contents

module ApiResource
  module Associations
    module HasManyThroughRemoteObjectProxy
      def has_many_through_remote(association, options) 
        self.instance_eval do
          send(:define_method, association) do
            send(options[:through]).collect{ |t| t.send(association.to_s.singularize) }.flatten  
          end
        end
      end
    end    
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
api_resource-0.6.5 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.4 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.3 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.2 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.1 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.0 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.5.1 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.5.0 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.4.3 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.4.2 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.4.0 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.3.14 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.3.13 lib/api_resource/associations/has_many_through_remote_object_proxy.rb