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
Undeclared properties #1294
Undeclared properties #1294
Conversation
Looking for suggestion how to fix the 1 rubocop offense, which is a too long module. I just introduced the absolutely necessary hooks. I could split the persistence module into create and update persistence. |
I really like the way you implemented this! Out of curiosity, would it be preferable to require that undeclared properties be set and accessed through dedicated methods instead of mixed with existing mass-assignment? My concern is that this approach could lead to accidental, invisible setting of incorrect keys. If the user knows that they are going to be adding keys dynamically, it seems like they should be able to programmatically assign them separately. What do you think? Full disclosure, I am not exactly the target audience for this, as I think that undeclared properties are pure evil. I won't stand in the way of a merge if others give their +1. ;-) |
@subvertallchris I couldn't think of more intuitive way than using the standard Furthermore, there is an additional safety net in form of permitted attributes in rails controllers. So in our case, those fields are not totally wild. The superset of allowed undeclared properties is restricted on user/client basis. |
Current coverage is 97.01% (diff: 100%)@@ master #1294 diff @@
==========================================
Files 199 201 +2
Lines 12051 12148 +97
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 11688 11785 +97
Misses 363 363
Partials 0 0
|
Got it, thanks for the background info. |
I also really like how this is an optional module. I looked through the code and couldn't find anything bad, so |
I like this! |
Great, merging! Thanks again! |
Fixes #
Introduces handling of undeclared properties via optional Neo4j::UndeclaredProperties module.
This pull introduces/changes:
Pings:
@cheerfulstoic
@subvertallchris