Thanks, I took a closer look at the table_map option and the remainder of
the CTI documentation, but a few things are still not clear to me.
1) Does the `Manager` model load the `class_table_inheritance` plugin, too
(since it's also a superclass using CTI)? If so, does it need `key`
different from the `key` in the `Employee` model?
2) Do the models `Staff` and `Executive` load the
`single_table_inheritance` plugin? If so, what about their `key?
And on a side note: There's a typo (double colon) in the usage code:
# Specifying the tables with a :table_map hash
Employee.plugin :class_table_inheritance,
table_map: {...
CEO: ::executives }
On Sunday, 17 September 2017 16:41:37 UTC+2, Jeremy Evans wrote:
>
> On Sunday, September 17, 2017 at 7:36:30 AM UTC-7, Eugen K wrote:
>>
>> Is there a way to specify the table name for a Sequel::Model that uses
>> class table inheritance?
>>
>> # table name: loc_id_bases
>> class LocIdBase < Sequel::Model
>> plugin :class_table_inheritance, key: :kind, alias: :loc_id_bases
>> end
>>
>> # table name: symbols
>> class OMSSymbol < LocIdBase
>> end
>>
>> If we weren't using CTI, we would have defined the class like this:
>> class OMSSymbol < Sequel::Model(:symbols)
>>
>> We can't just use
>> class OMSSymbol < LocIdBase(:symbols)
>> because LocIdBase is not a method. Is there a way to set the table name
>> in this case? I couldn't find this in the docs.
>>
>
> You want to use the :table_map option. See
> http://sequel.jeremyevans.net/rdoc-plugins/classes/Sequel/Plugins/ClassTableInheritance.html#module-Sequel::Plugins::ClassTableInheritance-label-Usage
>
> 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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.