Sha256: fdf9fb537b40faa7be795306d200249dcb9b045d942540ba605e8ff4686eebc8

Contents?: true

Size: 518 Bytes

Versions: 5

Compression:

Stored size: 518 Bytes

Contents

module SchemaPlus
  module ActiveRecord
    module Attribute
      def self.included(base)
        base.alias_method_chain :original_value, :schema_plus
      end

      def original_value_with_schema_plus
        # prevent attempts to cast DB_DEFAULT to the attributes type.
        # We want to keep it as DB_DEFAULT so that we can handle it when
        # generating the sql.
        return DB_DEFAULT if value_before_type_cast == DB_DEFAULT
        original_value_without_schema_plus
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
schema_plus-1.8.4 lib/schema_plus/active_record/attribute.rb
schema_plus-1.8.3 lib/schema_plus/active_record/attribute.rb
schema_plus-1.8.2 lib/schema_plus/active_record/attribute.rb
schema_plus-1.8.1 lib/schema_plus/active_record/attribute.rb
schema_plus-1.8.0 lib/schema_plus/active_record/attribute.rb