-
Notifications
You must be signed in to change notification settings - Fork 901
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
Helper for queries on Version object
fields
#377
Comments
I like this idea. I'm sure if you have a lot of versions in your table, this search is probably pretty slow, but still a nice feature to have. A PR would be be great, cheers. |
If you do, can you try and make it storage specific. I'm using the PG |
Yep, definitely. |
Awesome, thanks guys. I'll try to get this out by the end of the week. |
So just to clarify, my understanding is that this should have the ability to perform a string ( |
Yea I think that sounds about right. You can probably first do a check to see if it's using the Postgres JSON, then if it's not, check the serializer in usage by calling |
@bradleypriest any help on a native JSON query would be much appreciated. I haven't been able to figure out how to get basic field comparisons working in Postgres 9.3 without resorting to using If you could, SQL examples (for querying JSON on all different JSON data types) would be wonderful! |
Would there be interest in adding a method to the concern that allows queries to be made more safely/easily on the
object
serialized field?I'm thinking something like:
VersionClass.where_object(name: "Foo", other_field: 42)
which translates into:
I end up making these queries fairly frequently, and I find them easy to mess up (for instance, forgetting the
\n
or%
s) and I think a method to automate this would be helpful. I'm more than happy to submit a pull request for this change if it's something others would want as well.The text was updated successfully, but these errors were encountered: