-
Notifications
You must be signed in to change notification settings - Fork 15
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
ParseModel::Model initialize bug? #13
Comments
Hmm, that is odd. The issue can probably be traced here in Maybe this is unsatisfactory, but what would you think if I eliminated mass-assignment? Seems to have caused issues in the Rails-ecosystem. Especially considering Parse lets you "create" a column by simply writing to it... |
I've poked around Model.rb. The problem seems to be that line 7,
returns true for any non nil object. The second if statement that checks for a hash never gets called as a result. I don't see why using bundler causes this to happen vs. just placing the files in lib/ or vendor/ or whatever. In the meantime, I've overridden the module's initialize method to allow me to do roughly the same thing, only with a block instead of a hash:
As for eliminating mass assignment, I guess I don't know enough to form a strong opinion. Added security is always nice, but I don't know nearly enough about Parse in general to know what the risks of mass assignment are here. It's probably not the direction you want to go, but if you'd like me to submit my init method in a pull request, just let me know. *Edit for clarity |
When ParseModel is added to a project using bundler, ParseModel::Model initialize, when given a hash as an argument, assigns that hash to @PFObject. I got this in the console:
When I add ParseModel to my project as a submodule, everything works as it should.
The text was updated successfully, but these errors were encountered: