Sha256: 020dbb8d8ae343b584342ba5d6b936b542a1558476f9f04c81b4431464fc8754

Contents?: true

Size: 406 Bytes

Versions: 1

Compression:

Stored size: 406 Bytes

Contents

module ApiResource
  module Associations
    class BelongsToRemoteObjectProxy < SingleObjectProxy

      def initialize(klass, owner)
        super(klass, owner)
        
        # now if we have an owner and a foreign key, we set the data up to load
        if key = owner.send(self.klass.to_s.foreign_key)
          self.remote_path =  self.klass.element_path(key)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
api_resource-0.6.4 lib/api_resource/associations/belongs_to_remote_object_proxy.rb