-
Notifications
You must be signed in to change notification settings - Fork 121
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
alias gid group_id #34
Comments
👍 |
I’m not so sure. Anything we pick can potentially have side effects, and I don’t want to end up with model#__gid or something like that. Let’s give people a graceful way of handling the conflict, though. On Aug 26, 2014, at 7:40 AM, Abdelkader Boudih notifications@github.com wrote:
|
Isn't And |
I started with the long name, and then found it really annoying when used in stuff like options for select and so forth. But it wouldn’t be the end of the world to go with that. I can take another stab at making a feel for it in our app. On Aug 26, 2014, at 8:04 AM, Matthew Draper notifications@github.com wrote:
|
I am not sure what to use either, no matter what you pick there are going to be conflicts, especially with short names since all the good ones are taken (kinda like domain names). To me I see gid causing a decent amount of conflicts due to its use in posix/unix like systems. And yes model#__gid would be horrible, but what about something like g_id? Still not sure I like it,, but way better than __gid.. Currently i just changed my code to be u_gid and u_uid, but when I deploy this to production, going to have to change a bunch of external systems that use these tables as well |
I say we go with global_id. Seems like the likelihood of collision is fairly low, and if you don't already use gid and prefers a shorter name, you can just add the alias in your application |
Another alternative is 'to_gid' which draws a parallel to 'to_param'. But 'global_id' probably still my first pick. And feiw I agree with Matthew that sgid is 👎 |
Thought about this too. I actually thought more ppl would collide with |
|
I actually like #to_gid. It's a serialization format, so that makes sense to me. Another parallel is #to_json. I say we go with #to_*.
|
Fixed in 8f893e1. |
Upgrading an internal app to Rails 4.2 beta, and this alias hit me pretty hard. The app deals with file system permissions and as gid is the numeric group id, it is used heavily in modeling file system users.. Since now all my AR models can't use gid as an field anymore. so lots of renaming columns. Tried aliasing it, but that didn't work (as expected) Not sure if I should post this here or Active Record? Figure since this is where it is defined. I am probably not the only person to be bit by this. No real work around, that I can see..
The text was updated successfully, but these errors were encountered: