Sha256: 1065a6aa9ffbd86e9dc36e83563c0e68f7eac9fb3c1c993bea99cd431e349893

Contents?: true

Size: 640 Bytes

Versions: 5

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true
require 'arel/attributes/attribute'

module Arel
  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

5 entries across 5 versions & 3 rubygems

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