On Monday, December 10, 2018 at 11:24:46 PM UTC-8, Ben Alavi wrote: > > Think I found a bug with this: it doesn't qualify subclasses of subclasses > as table_name will return the alias when subclassing a subclass. Checking > cti_table_name rather than table_name works, but I believe it is slightly > different functionality in that it will inherit the qualifier from the > closest subclass and not from the base class. I think that probably fits > what one would expect to happen though. > > i.e.: > > class Album < Sequel::Model(Sequel.qualify(:charts, :albums)) > plugin :class_table_inheritance, key: :type, qualify_tables: true > end > > class SoldAlbum < Album # <- will use charts.sold_albums > end > > class PlatinumAlbum < SoldAlbum # <- will try to use albums (the subquery > alias) rather than charts.platinum_albums > end > > Any issue w/ using cti_table_name? > > Patch w/ spec: > https://gist.github.com/benalavi/884a3eb7d7497c0114610e3c76faf2ef -- if > this looks good will submit a PR >
Thanks for looking into this. I agree with your approach, can you please submit that as a PR? 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.
