Is is possible to set a default value for the new native Hstore column?
I'll quote @jjb, who explains the problem at issue 22 of activerecord-postgres-hstore gem:
Here's a problem I have, which might be (very?) common for users of this gem: I have a model Foo with an hstore column metadata. It's possible that it has no metadata at all, or many key/values. Wherever I access the metadata, I have to do ye olde @foo.metadata && @foo.metadata['my_key'] because @foo.metadata might be nil.
I would rather that in the case of a NULL metadata column, @foo.metadata returned {}. In my use case, metadata being nil has no semantic purpose.
Seems like it was solved for the gem in this commit.
Is is possible to set a default value for the new native Hstore column?
I'll quote @jjb, who explains the problem at issue 22 of activerecord-postgres-hstore gem:
Seems like it was solved for the gem in this commit.