Sha256: 092d6ebac2db5532902de9b6b431dd32acd453829a0cad851dcea94ab7d507a1

Contents?: true

Size: 629 Bytes

Versions: 7

Compression:

Stored size: 629 Bytes

Contents

require "active_model/type/string"

module ActiveRecord
  module OracleEnhanced
    module Type
      class Text < ActiveRecord::Type::Text # :nodoc:
        def changed_in_place?(raw_old_value, new_value)
          #TODO: Needs to find a way not to cast here.
          raw_old_value = cast(raw_old_value)
          super
        end

        def serialize(value)
          return unless value
          Data.new(super)
        end

        class Data # :nodoc:
          def initialize(value)
            @value = value
          end

          def to_s
            @value
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
activerecord-oracle_enhanced-adapter-1.8.2 lib/active_record/oracle_enhanced/type/text.rb
activerecord-oracle_enhanced-adapter-1.8.1 lib/active_record/oracle_enhanced/type/text.rb
activerecord-oracle_enhanced-adapter-1.8.0 lib/active_record/oracle_enhanced/type/text.rb
activerecord-oracle_enhanced-adapter-1.8.0.rc3 lib/active_record/oracle_enhanced/type/text.rb
activerecord-oracle_enhanced-adapter-1.8.0.rc2 lib/active_record/oracle_enhanced/type/text.rb
activerecord-oracle_enhanced-adapter-1.8.0.rc1 lib/active_record/oracle_enhanced/type/text.rb
activerecord-oracle_enhanced-adapter-1.8.0.beta1 lib/active_record/oracle_enhanced/type/text.rb