On Tue, Jun 10, 2014 at 4:34 PM, Ivailo Bardarov <[email protected]> wrote:
Doesn't matter if the column comes statically or dynamically. The presence > of the "type" virtual-column in the record should be enough. > > record[inheritance_column].present? > > instead of > > record[inheritance_column].present? && columns_hash.include?( > inheritance_column) > > What do you think? > AR assumes the column exists. STI needs the column to perform certain queries related to the hierarchy as I showed before. If AR cannot assume the column exists, then we need to introduce logic to account for that in those queries, and so on. The design deviates. There's no need for the design to deviate, AR models STI and STI has a type column. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" 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 http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.
