Module: Logidze::Migration
- Defined in:
- lib/logidze/migration.rb
Overview
Contains helpers for handling different PG versions
Instance Method Summary collapse
- #current_setting(name) ⇒ Object
-
#current_setting_missing_supported? ⇒ Boolean
Checks whether pg function ‘current_setting` support `missing_ok` argument (since 9.6).
Instance Method Details
#current_setting(name) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/logidze/migration.rb', line 11 def current_setting(name) if current_setting_missing_supported? "current_setting('#{name}', true)" else "current_setting('#{name}')" end end |
#current_setting_missing_supported? ⇒ Boolean
Checks whether pg function ‘current_setting` support `missing_ok` argument (since 9.6)
7 8 9 |
# File 'lib/logidze/migration.rb', line 7 def current_setting_missing_supported? ActiveRecord::Base.connection.send(:postgresql_version) >= 90_600 end |