Method: Dynamoid::Document::ClassMethods#hash_key

Defined in:
lib/dynamoid/document.rb

#hash_keySymbol

Returns the hash key field name for this class.

By default id field is used. But it can be overriden in the table method call.

User.hash_key # => :id

Returns:

  • (Symbol)

    a hash key name

Since:

  • 0.4.0



68
69
70
# File 'lib/dynamoid/document.rb', line 68

def hash_key
  options[:key] || :id
end