Skip to content

Commit 4016e2f

Browse files
committed
Add an example into the .table method documentation
1 parent 6e93000 commit 4016e2f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/dynamoid/fields.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ def range(name, type = :string, options = {})
197197
# field :id, :integer
198198
# end
199199
#
200+
# To declare a new attribute with not-default type as a table hash key a
201+
# :key_type option can be used:
202+
#
203+
# class User
204+
# include Dynamoid::Document
205+
#
206+
# table key: :user_id, key_type: :integer
207+
# end
208+
#
200209
# @param options [Hash] options to override default table settings
201210
# @option options [Symbol] :name name of a table
202211
# @option options [Symbol] :key name of a hash key attribute

0 commit comments

Comments
 (0)