Skip to content

Conversation

@Gaurav2728
Copy link

#9

After adding preferences column using migration and also populate data using migration preferences column not updated with HashWithIndifferentAccess.new

We need to reset the self.class.reset_column_information and set preferences as a Hash
Now preferences column able to write/store all preferences attributes

asanghi#9

After adding preferences column using migration and also populate data using migration preferences column not updated with HashWithIndifferentAccess.new 

We need to reset the self.class.reset_column_information and set preferences as a Hash
Now preferences column able to write/store all preferences attributes
if self.preferences.class != Hash
self.class.reset_column_information
self.preferences = {}
write_preference_attribute(self.class._preferences_attribute,key,self.class.preference_definition(key).value(value))
Copy link
Author

Choose a reason for hiding this comment

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

@asanghi It's not the perfect solution. It'll fail when we set preferences(:foo) in the model. You can suggest a better approach.

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.

1 participant