Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Does this plugin support a null value in hstore column? #107

Open
tamoyal opened this issue Jul 14, 2013 · 1 comment
Open

Does this plugin support a null value in hstore column? #107

tamoyal opened this issue Jul 14, 2013 · 1 comment

Comments

@tamoyal
Copy link

tamoyal commented Jul 14, 2013

I got a syntax error, assuming that AR didn't know how to serialize the hash into an hstore query part and saw a few posts saying I needed to add this:
serialize :offer_providers, ActiveRecord::Coders::Hstore
which I initially avoided because I want to select on rows with my hstore column null.

As I suspected, this does set the hstore to empty as opposed to null. How can I get the serialization but not have it save {} when I don't have any values for the hstore?

@tamoyal
Copy link
Author

tamoyal commented Jul 14, 2013

Sorry it's late. The value is actually null in the database but comes out as {} when accessing it. It's a little weird but no strong opinions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant