Format literals as major_minor_patch

pull/15895/head
Alberto Miedes Garcés 4 years ago
parent 618a9e1ef8
commit b68477371f

@ -215,7 +215,9 @@ module Carto
# CTEs were materialized by default until PG11, but PG12 changed it.
# https://www.depesz.com/2019/02/19/waiting-for-postgresql-12-allow-user-control-of-cte-materialization-and-change-the-default-behavior/
def force_cte_materialization_keyword
'MATERIALIZED' if carto_user.db_service.pg_server_version > 120_000
# rubocop:disable Style/NumericLiterals
'MATERIALIZED' if carto_user.db_service.pg_server_version > 12_00_00
# rubocop:enable Style/NumericLiterals
end
end

@ -28,7 +28,9 @@ describe Carto::UserDBService do
it 'returns the PostgreSQL server version number' do
# Support all versions of CI. Don't stub as that would make the spec useless.
expect([110_005, 120_001, 120_002]).to include(subject)
# rubocop:disable Style/NumericLiterals
expect([11_00_05, 12_00_01, 12_00_02]).to include(subject)
# rubocop:enable Style/NumericLiterals
end
end
end

Loading…
Cancel
Save