On Monday, October 28, 2013 3:53:38 AM UTC-7, Jamie Hodge wrote:
> As an extension of this question, the lack of a UUID extension means that
> empty strings are being submitted to the database, resulting in errors. How
> do I strip empty strings, while still allowing for nil values (to remove a
> value)?
>
I'm unsure what you mean by strip empty strings:
"".strip == ""
Maybe you mean ignore empty strings in input:
def uuid_column=(v)
super unless v == ''
end
Or remove them before saving:
def before_save
super
values.delete(:uuid_column) if uuid_column == ''
end
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.