FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add key_type option to table method by ogidow · Pull Request #910 · Dynamoid/dynamoid · GitHub

Add key_type option to table method - #910

Merged
andrykonchin merged 5 commits into
Dynamoid:masterfrom
ogidow:add-key-type-option
Jun 8, 2025
Merged

Add key_type option to table method#910
andrykonchin merged 5 commits into
Dynamoid:masterfrom
ogidow:add-key-type-option

Conversation

ogidow commented Jun 1, 2025

Copy link
Copy Markdown
Contributor

My project uses integer type hash key.

Currently, if we specify integer key to hash key, we need to do below process on dynamoid

  1. define hash key with table method
  2. override hash key type by field method
class Model
  include Dynamoid::Document
  
  table key: :hash_key # hash_key define as string type

  field :hash_key, :integer # override hash_key type to integer from string
end

But, when we override attribute, dynamoid notice us warning message like

'Method hash_key= generated for the field hash_key overrides already existing method'
'Method hash_key generated for the field hash_key overrides already existing method'

So, I'd like to add key_type option to specify type to hash key on table method to avoid warning message.

Copy link
Copy Markdown
Member

Thank you! Looks good. I was considering this feature for a long time.

Copy link
Copy Markdown
Member

There is nothing to do for you - I will handle the CI failure.

andrykonchin force-pushed the add-key-type-option branch from 583c816 to a539da8 Compare June 8, 2025 13:24
andrykonchin force-pushed the add-key-type-option branch from a539da8 to 78dabe7 Compare June 8, 2025 13:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL