-
Notifications
You must be signed in to change notification settings - Fork 167
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
Underscore in field name #12
Comments
Asking the same question! Btw... I think that enum options should be strings (e.g. enum status: ["pending", "ready"] ). |
+1 |
1 similar comment
+1 |
To be honest - I can't 100% remember my motivations for doing this. If I had to guess - it was probably to indicate that the field shouldn't be directly access, except through the getters and setters - following on from a few other (similar) gems that do similar things. @xpepermint What are your thoughts on strings vs. symbols? I felt like symbols would be a better choice here, given that the values are immutable, but curious to hear why you feel these should be strings. |
@thetron Huh, I don't remember exactly why but I think I was looking at rails |
There's 5+ forks only to remove the underscore. +1 for me hehe. |
Thanks everyone again for your feedback here. I've merged in #12, which added a configuration option to customise the prefix. At some point in the future we might switch the default to be an empty string, but I wanted to make it easy for existing and future users to continue using the gem on the path to v1.0.0, and support for mongoid 5. 🍰 |
explanation for thetron#12
What is the reason for using underscore in fieldname?
Actually we get another attribute that differ one we created
The text was updated successfully, but these errors were encountered: