Sha256: 19dab3176cb4192d4e3fcf7726344087dc5ef5445926987d680e0ed3c8db66ca

Contents?: true

Size: 532 Bytes

Versions: 1

Compression:

Stored size: 532 Bytes

Contents

require 'dm-salesforce-adapter/property'


module DataMapper
  module Adapters
    class SalesforceAdapter < DataObjectsAdapter
      module Property
        class Boolean < ::DataMapper::Property::Integer
          FALSE = 0
          TRUE  = 1

          def load(value)
            [true, 1, '1', 'true', 'TRUE', TRUE].include?(value) ? true : false
          end

          def typecast(value)
            [true, 1, '1', 'true', 'TRUE', TRUE].include?(value) ? TRUE : FALSE
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
martinemde-dm-salesforce-adapter-1.1.0 lib/dm-salesforce-adapter/property/boolean.rb