Sha256: e5e3e45ff5c7dca7f41acc036c74adbe811e13257e36d1bac9c07f2033efd318

Contents?: true

Size: 575 Bytes

Versions: 23

Compression:

Stored size: 575 Bytes

Contents

require 'api_resource/associations/multi_object_proxy'
module ApiResource
  module Associations
    class HasManyRemoteObjectProxy < MultiObjectProxy
      def initialize(klass_name, contents, owner)
        super
        return if self.internal_object.present? || self.remote_path
        # now if we have an owner and a foreign key, we set the data up to load
        if owner
          self.load({"service_uri" => self.klass.collection_path(self.owner.class.to_s.foreign_key => self.owner.id)}.merge(self.klass.scopes))
        end
        true
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
api_resource-0.3.12 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.11 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.10 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.8 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.7 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.6 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.5 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.4 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.3 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.2 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.1 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.3.0 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.2.11 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.2.10 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.2.9 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.2.8 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.2.7 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.2.6 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.2.5 lib/api_resource/associations/has_many_remote_object_proxy.rb
api_resource-0.2.4 lib/api_resource/associations/has_many_remote_object_proxy.rb