Sha256: 855090765c35421d876506ed4581cbed98f256042652d2575c59d83dc56724de

Contents?: true

Size: 455 Bytes

Versions: 11

Compression:

Stored size: 455 Bytes

Contents

require "active_record/connection_adapters/postgresql_adapter"

module ActiveRecord
  module PGEnum
    register :simplified_type do
      ConnectionAdapters::PostgreSQLColumn.prepend SimplifiedType
    end

    module SimplifiedType
      private

      def simplified_type(sql_type)
        if ConnectionAdapters::PostgreSQLAdapter::OID::NAMES[sql_type].type == :enum
          :enum
        else
          super
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
activerecord-pg_enum-2.0.0 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.2.2 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.2.1 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.2.0 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.1.0 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.0.5 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.0.4 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.0.3 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.0.2 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.0.1 lib/active_record/pg_enum/4.1/simplified_type.rb
activerecord-pg_enum-1.0.0 lib/active_record/pg_enum/4.1/simplified_type.rb