-
Notifications
You must be signed in to change notification settings - Fork 49
Advanced obsfucation #30
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
Conversation
4b3d8d9 to
a81e309
Compare
|
Nice! You're on fire! :) I'm not sure if I like this design better than the one you proposed on #29. I'll think about this some more before I weigh in.. We need to make sure this is backwards compatible though (I'm assuming it is) |
|
Yea, this works with the existing config format. I think I'm more of a fan of this because it's very easy to implement and easy to explain. At the moment I'm implementing a pretty large project with Polo so I'm adding things as I find I need them. If I think I need the other config style I'll whip it up and send a pull request. |
|
This is a good point. The string option is much easier to explain and implement. So this API might be a winner. |
|
Just thought of something else... Should we use the table name or model name in this case? I'm inclined to think that it should be the model name since we're operating on models. Also probably simpler to implement. A philosofical reason to operate on model names is the fact that Polo transforms AR records into SQL statments (Not the other way around) |
|
. |
a81e309 to
2a5d2c6
Compare
|
I see.. I think we should standardize on model names as opposed to the table name, mostly because Polo isn't too worried about what table those selects are coming from, especially now that we started using Arel for the generation. We could probably change the line where you do: instance.class.table_name == tableto something like if klass = class_name(field)
field = field_name(field)
end
instance.class.name == klass |
|
So the specs have namespaced models like I think the SQL convention is more intuitive for advanced usage since the ActiveRecord pattern is to expose SQL when things stop being simple. Either way it provides a needed capability and I'll update the README accordingly. |
|
that's a good point. This sounds good! Thanks again, @craigmcnamara |
|
Docs updated! |
README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a line that clarifies the difference between regular fields vs namespaced ones?
i.e. a naked field will by applied across every table, vs a namespaced one only being applied to that specific table.
Implement a table name scoped obfuscation config