Sha256: b451902d9fca594def620970e3013ecf31d4c94d261a978b83ca5150677a45d1

Contents?: true

Size: 748 Bytes

Versions: 80

Compression:

Stored size: 748 Bytes

Contents

# frozen_string_literal: true

module Arel # :nodoc: all
  module Nodes
    class TableAlias < Arel::Nodes::Binary
      alias :name :right
      alias :relation :left
      alias :table_alias :name

      def [](name)
        relation.is_a?(Table) ? relation[name, self] : Attribute.new(self, name)
      end

      def table_name
        relation.respond_to?(:name) ? relation.name : name
      end

      def type_cast_for_database(attr_name, value)
        relation.type_cast_for_database(attr_name, value)
      end

      def type_for_attribute(name)
        relation.type_for_attribute(name)
      end

      def able_to_type_cast?
        relation.respond_to?(:able_to_type_cast?) && relation.able_to_type_cast?
      end
    end
  end
end

Version data entries

80 entries across 76 versions & 8 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.7/lib/arel/nodes/table_alias.rb
activerecord-7.0.8.7 lib/arel/nodes/table_alias.rb
activerecord-7.0.8.6 lib/arel/nodes/table_alias.rb
activerecord-6.1.7.10 lib/arel/nodes/table_alias.rb
activerecord-6.1.7.9 lib/arel/nodes/table_alias.rb
activerecord-7.0.8.5 lib/arel/nodes/table_alias.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8.4/lib/arel/nodes/table_alias.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.5.1/lib/arel/nodes/table_alias.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.5.1/lib/arel/nodes/table_alias.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.5.1/lib/arel/nodes/table_alias.rb
activerecord-7.0.8.4 lib/arel/nodes/table_alias.rb
activerecord-6.1.7.8 lib/arel/nodes/table_alias.rb
activerecord-7.0.8.1 lib/arel/nodes/table_alias.rb
activerecord-6.1.7.7 lib/arel/nodes/table_alias.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-7.0.2.3/lib/arel/nodes/table_alias.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/arel/nodes/table_alias.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-7.0.3.1/lib/arel/nodes/table_alias.rb
activerecord-7.0.8 lib/arel/nodes/table_alias.rb
activerecord-7.0.7.2 lib/arel/nodes/table_alias.rb
activerecord-6.1.7.6 lib/arel/nodes/table_alias.rb