1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
def using_sqlite?
ActsAsTaggableOn::Utils.connection && ActsAsTaggableOn::Utils.connection.adapter_name == 'SQLite'
end
def supports_concurrency?
!using_sqlite?
end
def using_postgresql?
ActsAsTaggableOn::Utils.using_postgresql?
end
def postgresql_version
if using_postgresql?
ActsAsTaggableOn::Utils.connection.execute('SHOW SERVER_VERSION').first['server_version'].to_f
else
0.0
end
end
def postgresql_support_json?
postgresql_version >= 9.2
end
def using_mysql?
ActsAsTaggableOn::Utils.using_mysql?
end
def using_case_insensitive_collation?
using_mysql? && ActsAsTaggableOn::Utils.connection.collation =~ /_ci\Z/
end
|