Module: ActiveRemote::ScopeKeys::ClassMethods

Defined in:
lib/active_remote/scope_keys.rb

Instance Method Summary collapse

Instance Method Details

#scope_key(*keys) ⇒ Object

Allows you to define, at a class level, what keys should be used as identifiers when making remote calls. For instance,

class Tag < ActiveRemote::Base

scope_key :user_guid

end

When #scope_keys is called on Tag, it will return the primary key in addition to :user_guid as the scope keys.



24
25
26
# File 'lib/active_remote/scope_keys.rb', line 24

def scope_key(*keys)
  self._scope_keys += keys.map(&:to_s)
end

#scope_keysObject

Used to define what keys are required when making remote persistence or refresh calls.



32
33
34
# File 'lib/active_remote/scope_keys.rb', line 32

def scope_keys
  [primary_key.to_s] + _scope_keys
end