Sha256: 36e4409e02a4667176ad431e2ebdcf2af2df2dc1599acfde192de2b74cb4a180

Contents?: true

Size: 656 Bytes

Versions: 4

Compression:

Stored size: 656 Bytes

Contents

require 'active_model/type/string'

module ActiveRecord
  module OracleEnhanced
    module Type
      class String < ActiveModel::Type::String # :nodoc:
        def changed?(old_value, new_value, _new_value_before_type_cast)
          if old_value.nil?
            new_value = nil if new_value == ""
            old_value != new_value
          else
            super
          end
        end

        def changed_in_place?(raw_old_value, new_value)
          if raw_old_value.nil?
            new_value = nil if new_value == ''
            raw_old_value != new_value
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activerecord-oracle_enhanced-adapter-1.7.11 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.10 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.9 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.8 lib/active_record/oracle_enhanced/type/string.rb