Sha256: cfca977471284c418304391e450dbbf80c15c381eb36b3309f702d499e82313a

Contents?: true

Size: 656 Bytes

Versions: 39

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

require "arel/attributes/attribute"

module Arel # :nodoc: all
  module Attributes
    ###
    # Factory method to wrap a raw database +column+ to an Arel Attribute.
    def self.for(column)
      case column.type
      when :string, :text, :binary             then String
      when :integer                            then Integer
      when :float                              then Float
      when :decimal                            then Decimal
      when :date, :datetime, :timestamp, :time then Time
      when :boolean                            then Boolean
      else
        Undefined
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 4 rubygems

Version Path
activerecord-6.0.6.1 lib/arel/attributes.rb
activerecord-6.0.6 lib/arel/attributes.rb
activerecord-6.0.5.1 lib/arel/attributes.rb
activerecord-6.0.5 lib/arel/attributes.rb
activerecord-6.0.4.8 lib/arel/attributes.rb
activerecord-6.0.4.7 lib/arel/attributes.rb
activerecord-6.0.4.6 lib/arel/attributes.rb
activerecord-6.0.4.5 lib/arel/attributes.rb
activerecord-6.0.4.4 lib/arel/attributes.rb
activerecord-6.0.4.3 lib/arel/attributes.rb
activerecord-6.0.4.2 lib/arel/attributes.rb
activerecord-6.0.4.1 lib/arel/attributes.rb
activerecord-6.0.4 lib/arel/attributes.rb
activerecord-6.0.3.7 lib/arel/attributes.rb
activerecord-6.0.3.6 lib/arel/attributes.rb
activerecord-6.0.3.5 lib/arel/attributes.rb
activerecord-6.0.3.4 lib/arel/attributes.rb
activerecord-6.0.3.3 lib/arel/attributes.rb
activerecord-6.0.3.2 lib/arel/attributes.rb
activerecord-6.0.3.1 lib/arel/attributes.rb