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-7.1.0 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-7.1.0.beta2 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-7.1.0.beta1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-7.0.3 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-7.0.2 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.1.6 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-7.0.1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-7.0.0 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-7.0.0.rc1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.1.5 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.1.4 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.1.2 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.1.1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.6 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.5 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.1.0 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.1.0.rc1 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.4 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-6.0.3 lib/active_record/type/oracle_enhanced/string.rb
activerecord-oracle_enhanced-adapter-5.2.8 lib/active_record/type/oracle_enhanced/string.rb