Sha256: 25bdb417f1b7c7e2c4a6a8ed22875602d49de31061b036b447363af8ef58da58

Contents?: true

Size: 610 Bytes

Versions: 173

Compression:

Stored size: 610 Bytes

Contents

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

173 entries across 151 versions & 23 rubygems

Version Path
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/attributes.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/attributes.rb
fc-webicons-0.0.1 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/attributes.rb
arel-4.0.0.beta2 lib/arel/attributes.rb
arel-4.0.0.beta1 lib/arel/attributes.rb
active_mailer-0.0.5 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/attributes.rb
active_mailer-0.0.4 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/attributes.rb
active_mailer-0.0.3 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/attributes.rb
challah-0.9.1.beta.3 vendor/bundle/gems/arel-3.0.2/lib/arel/attributes.rb
devise_sociable-0.1.0 vendor/bundle/gems/arel-3.0.2/lib/arel/attributes.rb
challah-0.9.1.beta vendor/bundle/gems/arel-3.0.2/lib/arel/attributes.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/lib/arel/attributes.rb
challah-0.9.0 vendor/bundle/gems/arel-3.0.2/lib/arel/attributes.rb
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/attributes.rb
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/attributes.rb
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/arel-2.2.1/lib/arel/attributes.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/arel-3.0.2/lib/arel/attributes.rb
challah-rolls-0.2.0 vendor/bundle/gems/arel-3.0.2/lib/arel/attributes.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/arel-3.0.2/lib/arel/attributes.rb
challah-0.8.3 vendor/bundle/gems/arel-3.0.2/lib/arel/attributes.rb