Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolize keys in update_properties #165

Open
wants to merge 1 commit into
base: 3.0.3
Choose a base branch
from

Conversation

ErickFabian
Copy link
Contributor

Doing

user.update_properties!('first_name' => 'erick')

causes a Dolly::InvalidProperty error, which is confusing i think, so to provide a better developer experience i transform the keys to symbols to comply with using symbols and avoid creating string objets

@@ -17,7 +17,7 @@ def save!
end

def update_properties(properties)
properties.each(&update_attribute)
properties.deep_symbolize_keys.each(&update_attribute)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will duplicate in memory each key and value being transformed. We need a more performant way to do this... (C-ext coff coff)

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