We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
field
1 parent beaa718 commit 0152004Copy full SHA for 0152004
lib/dynamoid/fields.rb
@@ -128,6 +128,19 @@ module ClassMethods
128
# user.age # => 21 - integer
129
# user.age_before_type_cast # => '21' - string
130
#
131
+ # There is also an option +alias+ which allows to use another name for a
132
+ # field:
133
+ #
134
+ # class User
135
+ # include Dynamoid::Document
136
137
+ # field :firstName, :string, alias: :first_name
138
+ # end
139
140
+ # user = User.new(firstName: 'Michael')
141
+ # user.firstName # Michael
142
+ # user.first_name # Michael
143
144
# @param name [Symbol] name of the field
145
# @param type [Symbol] type of the field (optional)
146
# @param options [Hash] any additional options for the field type (optional)
0 commit comments