method

new

rails latest stable - Class: Arel::Table
new(name, as: nil, klass: nil, type_caster: klass&.type_caster)
public

No documentation available.

# File activerecord/lib/arel/table.rb, line 14
    def initialize(name, as: nil, klass: nil, type_caster: klass&.type_caster)
      @name =
        case name
        when Symbol then name.to_s
        else
          name
        end

      @klass = klass
      @type_caster = type_caster

      # Sometime AR sends an :as parameter to table, to let the table know
      # that it is an Alias.  We may want to override new, and return a
      # TableAlias node?
      if as.to_s == @name
        as = nil
      end
      @table_alias = as
    end