Sha256: 12dd891173f222f18724ab9480d260fb4df88fb44c86fb9804d463a608e914d4

Contents?: true

Size: 482 Bytes

Versions: 1

Compression:

Stored size: 482 Bytes

Contents

# frozen_string_literal: true

require "active_record"
require "active_record/connection_adapters/postgresql_adapter"

ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:integer][:limit] = 8

ActiveRecord::Type.class_eval do
  extension = Module.new do
    def column(name, type, **options)
      type = :bigint if type == :integer
      super(name, type, **options)
    end
  end

  ActiveRecord::ConnectionAdapters::TableDefinition.prepend(extension)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ar-bigint-0.2.0 lib/ar/bigint.rb