Skip to content

Conversation

@bdewater
Copy link
Contributor

@bdewater bdewater commented Jul 6, 2016

I've been using this in my application using Postgres' JSONB data type for the data column and it is working well for my needs. For example I can use something like the code below to get a list of sessions so the user can select one to log out:

Session.where(%(data @> '{"user_id": ?}'), current_user.id)

I'm unsure what the best way is to go about adding tests for this - do we need to add PostgreSQL/MySQL to the test suite?

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @sikachu (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@bdewater bdewater changed the title Add NullSerializer Add NullSerializer for JSON database columns Apr 12, 2017
@rafaelfranca rafaelfranca merged commit 8b76833 into rails:master May 11, 2017
@bdewater bdewater deleted the null_serializer branch May 12, 2017 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants