Sha256: cdb07ec53a08ee5bd40bf73025db045e670227acc91f603893cb3bd2afd81a37
Contents?: true
Size: 829 Bytes
Versions: 3
Compression:
Stored size: 829 Bytes
Contents
class JSONColumn include ActiveRecord::ConnectionAdapters def self.call new.call end def call ruby? && sphinx? && 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 def sphinx? ENV['SPHINX_VERSION'].nil? || ENV['SPHINX_VERSION'].to_f > 2.0 end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
thinking-sphinx-3.4.2 | spec/support/json_column.rb |
thinking-sphinx-3.4.1 | spec/support/json_column.rb |
thinking-sphinx-3.4.0 | spec/support/json_column.rb |