Following up the issue I posted here 
<https://github.com/jeremyevans/sequel/issues/1624> (Sorry if I should have 
directed it here first)

I'm wondering why the behavior is to return the receiver instead of the 
subclass? Could you override the create for STI models like so? Are there 
any negative side effects to this method? Maybe make it optional on a per 
class basis?


def self.create(**args)
  (self.sti_model_map[args[self.sti_key]] || self.to_s.to_sym).to_s.
constantize.create(args)
end

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/394cbe34-283a-48b5-a328-ca62325af46f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to