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

bugfix: undefined method `[]' for nil:NilClass [WIP] #10

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

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