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.25 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.24 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.23 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.22 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.21 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.20 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.19 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.18 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.17 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.16 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.15 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.14 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.13 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.12 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.11 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.9 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.10 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.8 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.7 lib/api_resource/associations/has_many_through_remote_object_proxy.rb
api_resource-0.6.6 lib/api_resource/associations/has_many_through_remote_object_proxy.rb