On Oct 13, 1:13 pm, philip <[email protected]> wrote: > I would love to be able to use the similar subclassing from Base > approach as I did in AR, as that makes codebase more nimble and > flexible down the road (e.g. common methods can all be in Base).
Note that if classes need to share behavior, they can always use the same plugins or modules instead of an artificial class inheritance hierarchy. > I > think the only mechanism missing in Sequel is a similar > "abstract_class = true" -- I know from Sequel documentation that > Sequel omits this because of a different way of handling STI and > inheritance. Correct, Sequel uses the single_table_inheritance plugin for STI. Sequel isn't missing "abstract_class = true", that's Sequel's default behavior. So pretty much anything you would want to do in AR with "abstract_class = true", you can do in Sequel. > But I guess Sequel didn't get to think of this use case > where abstract_class can work out great in helping refactoring (?). > It's a simple thing to add, I would imagine, and the value is great. > So just my feedback. ;) Um, Sequel already handles that case just fine. :) Maybe this is a simple solution for what you want. In your environment/initializer: module Db1 Model = Sequel::Model(Sequel.connect(...)) end In your model file: module Db1 class A < Model end end For additional configuration, you could also use Model.class_eval in the environment/initializer. That should give you all the flexibility you require. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
