Sha256: 2da98bb6d983c963bb23ec83d0460509af3b96870ce510fcb08830b816f911a5

Contents?: true

Size: 717 Bytes

Versions: 85

Compression:

Stored size: 717 Bytes

Contents

# frozen_string_literal: true

module Arel # :nodoc: all
  module Attributes
    class Attribute < Struct.new :relation, :name
      include Arel::Expressions
      include Arel::Predications
      include Arel::AliasPredication
      include Arel::OrderPredications
      include Arel::Math

      def type_caster
        relation.type_for_attribute(name)
      end

      ###
      # Create a node for lowering this attribute
      def lower
        relation.lower self
      end

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

      def able_to_type_cast?
        relation.able_to_type_cast?
      end
    end
  end

  Attribute = Attributes::Attribute
end

Version data entries

85 entries across 82 versions & 9 rubygems

Version Path
activerecord-8.0.2 lib/arel/attributes/attribute.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/activerecord-7.0.8.7/lib/arel/attributes/attribute.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.4/lib/arel/attributes/attribute.rb
activerecord-8.0.1 lib/arel/attributes/attribute.rb
activerecord-8.0.0.1 lib/arel/attributes/attribute.rb
activerecord-7.2.2.1 lib/arel/attributes/attribute.rb
activerecord-7.1.5.1 lib/arel/attributes/attribute.rb
activerecord-7.0.8.7 lib/arel/attributes/attribute.rb
activerecord-8.0.0 lib/arel/attributes/attribute.rb
activerecord-7.2.2 lib/arel/attributes/attribute.rb
activerecord-7.1.5 lib/arel/attributes/attribute.rb
activerecord-8.0.0.rc2 lib/arel/attributes/attribute.rb
activerecord-7.2.1.2 lib/arel/attributes/attribute.rb
activerecord-7.1.4.2 lib/arel/attributes/attribute.rb
activerecord-7.0.8.6 lib/arel/attributes/attribute.rb
activerecord-8.0.0.rc1 lib/arel/attributes/attribute.rb
activerecord-7.2.1.1 lib/arel/attributes/attribute.rb
activerecord-7.1.4.1 lib/arel/attributes/attribute.rb
activerecord-7.0.8.5 lib/arel/attributes/attribute.rb
activerecord-8.0.0.beta1 lib/arel/attributes/attribute.rb