Flowdock
type_condition(table_alias=nil) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/base.rb, line 1738
        def type_condition(table_alias=nil)
          quoted_table_alias = self.connection.quote_table_name(table_alias || table_name)
          quoted_inheritance_column = connection.quote_column_name(inheritance_column)
          type_condition = subclasses.inject("#{quoted_table_alias}.#{quoted_inheritance_column} = '#{sti_name}' ") do |condition, subclass|
            condition << "OR #{quoted_table_alias}.#{quoted_inheritance_column} = '#{subclass.sti_name}' "
          end

          " (#{type_condition}) "
        end
Register or log in to add new notes.