Sha256: db3c14b88c0a07b268d8869d77c3208c91a54e0131f811e71440dc21ce4e8a83

Contents?: true

Size: 657 Bytes

Versions: 16

Compression:

Stored size: 657 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

16 entries across 16 versions & 1 rubygems

Version Path
activerecord-oracle_enhanced-adapter-1.7.7 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.6 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.5 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.4 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.3 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.2 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.1 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0.rc1 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta7 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta6 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta5 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta4 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta3 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta2 lib/active_record/oracle_enhanced/type/string.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta1 lib/active_record/oracle_enhanced/type/string.rb