Hi Jeremy,

Kind of an oddball question, but if I have a validation on a belongs-to 
relationship (e.g. many_to_one :foo), the raised error points to the 
foreign key column (e.g. :foo_id). Is there any way to configure the 
validations plugin(s) to point to the relationship itself (e.g. :foo) 
instead of the FK? If not, would it be possible to add such functionality? 

Specifically, I'm seeing this behavior in Sequel 4.49 with the 
auto_validations plugin (with :not_null=>:presence) and a foreign key 
constraint violation in SQLite3. 

If you're curious as to why I'm asking, it's for conformity with the 
{json:api} spec, which requires the validation error response payload to 
contain pointers to the relationship on the client object. The client 
object may not be aware of the foreign key column details of the backend. 
More information on this can be found here 
<http://jsonapi.org/format/#error-objects> and here 
<https://tools.ietf.org/html/rfc6901>.

Thanks in advance for your thoughts,

Mike

-- 
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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to