Me or a need for an update to the README? #36

Closed
envygeeks opened this Issue Jul 13, 2012 · 2 comments

Projects

None yet

3 participants

@envygeeks

Rails: 3.2.6. I had to use the serializer on the gem from rubygems.org even though the README implies that you would only need to do that if you are using the 'development' version. Do we always need to use the serializer now? If so perhaps a documentation update?

The model that tripped me up for a minute at first:

class Page < ActiveRecord::Base
  validates_presence_of(:type, :data); belongs_to(:user, readonly: true)
end

It was a simple model, yes it was using a OpenStruct or SuperStruct (my own beefed up custom version of OpenStruct) but I had added [to|from]_hstore to work around potential issues... Even when I was working with a raw hash I would always get:

INSERT INTO "pages" ("data", "type") VALUES ($1, $2) RETURNING "id" [["data", {"slug"=>"Test"}], ["type", "page"]]
ActiveRecord::StatementInvalid: PG::Error: ERROR: Syntax error near 's' at position 4

That is, until I implemented the serializer and it started turning it properly.

@tadast
tadast commented Jul 13, 2012

You are right, this started happening some time between 0.3.0 and 0.4.0

@diogob
Owner
diogob commented Feb 4, 2013

Updated the README to comply with the new 0.7 (which provides only the custom serializer)

@diogob diogob closed this Feb 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment