Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Using built in postgresql_version - should be forwards compatible wit…

…h version 10+
  • Loading branch information...
commit a5e47d68c38014658f1bc90a10794b660d69e73a 1 parent b5694e7
Greg Barnett authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/database_cleaner/active_record/truncation.rb
6 lib/database_cleaner/active_record/truncation.rb
View
@@ -60,15 +60,15 @@ def truncate_table(table_name)
class PostgreSQLAdapter < AbstractAdapter
def db_version
- @db_version ||= select_value('SHOW SERVER_VERSION')
+ @db_version ||= postgresql_version
end
def cascade
- @cascade ||= db_version >= '8.2' ? 'CASCADE' : ''
+ @cascade ||= db_version >= 80200 ? 'CASCADE' : ''
end
def restart_identity
- @restart_identity ||= db_version >= '8.4' ? 'RESTART IDENTITY' : ''
+ @restart_identity ||= db_version >= 80400 ? 'RESTART IDENTITY' : ''
end
def truncate_table(table_name)
Please sign in to comment.
Something went wrong with that request. Please try again.