On Tuesday, October 15, 2013 1:02:05 AM UTC-7, Jamie Hodge wrote:

> I was trying to use the default_setters plugin with a postgres model that 
> includes uuid foreign keys. It appears, based on db_schema, that sequel is 
> not typecasting uuids and therefore leaving :ruby_default as nil. Is this a 
> matter of having yet another pg_* plugin to support uuids or is there a 
> workaround?
>

Well, that's two issues.  The first is not typecasting UUIDs (leaving them 
as plain strings).  A pg_uuid extension could be added that turned those 
strings into UUID objects, though I'm not sure how much that would help.

The second issue is not populating :ruby_default.  In general, Sequel only 
populates :ruby_default with values, so if the default value is an 
expression and not a value (e.g. a function call), then :ruby_default 
should rightly be nil.  What's the :default value in the schema hash for 
this uuid column?

Note that the default_setters plugin makes it easy to manually override the 
default values used in the models:

  Model.default_values[:column] = lambda{...}

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to