Sha256: d9824303ffc41b08e3f35eef6fa2756c31d6cd69233fbbbc9e0390ef51562e23

Contents?: true

Size: 687 Bytes

Versions: 35

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

require "active_model/type/string"

module ActiveRecord
  module Type
    module OracleEnhanced
      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

35 entries across 35 versions & 1 rubygems

Version Path
activerecord-oracle_enhanced-adapter-6.0.2 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.0 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.0.rc3 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.0.rc2 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.6 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.0.rc1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.0.beta1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.5 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.4 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.3 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.2 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.0 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.0.rc1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.0.beta1 lib/active_record/type/oracle_enhanced/string.rb