Sha256: 19f35dae0922bae00655e562866da4e08546365ab7dc7200d57a5487a832b0d6

Contents?: true

Size: 575 Bytes

Versions: 5

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true
module Arel
  module Nodes
    class TableAlias < Arel::Nodes::Binary
      alias :name :right
      alias :relation :left
      alias :table_alias :name

      def [] name
        Attribute.new(self, name)
      end

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

      def type_cast_for_database(*args)
        relation.type_cast_for_database(*args)
      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

5 entries across 5 versions & 3 rubygems

Version Path
spiral_form-0.1.1 vendor/bundle/gems/arel-9.0.0/lib/arel/nodes/table_alias.rb
spiral_form-0.1.0 vendor/bundle/gems/arel-9.0.0/lib/arel/nodes/table_alias.rb
nullifyable-0.1.0 vendor/bundle/gems/arel-9.0.0/lib/arel/nodes/table_alias.rb
arel-9.0.0 lib/arel/nodes/table_alias.rb
arel-8.0.0 lib/arel/nodes/table_alias.rb