Sha256: 50e5fe43a2a7232e73c627f7bad3ea1d02bf8682c79b4e0e474213a1c891ae9e
Contents?: true
Size: 761 Bytes
Versions: 17
Compression:
Stored size: 761 Bytes
Contents
# frozen_string_literal: true class JSONColumn include ActiveRecord::ConnectionAdapters def self.call new.call end def call ruby? && postgresql? && column? end private def column? ( ActiveRecord::ConnectionAdapters.constants.include?(:PostgreSQLAdapter) && PostgreSQLAdapter.constants.include?(:TableDefinition) && PostgreSQLAdapter::TableDefinition.instance_methods.include?(:json) ) || ( ActiveRecord::ConnectionAdapters.constants.include?(:PostgreSQL) && PostgreSQL.constants.include?(:ColumnMethods) && PostgreSQL::ColumnMethods.instance_methods.include?(:json) ) end def postgresql? ENV['DATABASE'] == 'postgresql' end def ruby? RUBY_PLATFORM != 'java' end end
Version data entries
17 entries across 17 versions & 1 rubygems