activerecord-pg-extensions 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3494201ce01b5c6d5104ae9ddb7f993310223ecc94bd902b2484ce6b6a4e525b
4
- data.tar.gz: acd5b4c842cbfc275b2a86f009c048e7916709803f3d72c9ed40f42095c47a7d
3
+ metadata.gz: ca67149b2f8917743b8258c14b7d2e393673093d02956a192ce40ed7857efa89
4
+ data.tar.gz: df37221b1ba08633bcb1d059ae296c4f83ec2025e6ad35eb87aaf50c7fdbaf39
5
5
  SHA512:
6
- metadata.gz: 91625c727722fb91aa1860960a3f9c5ba7ba4dcab0a0cf459e6b8301a7fa734ff91882f5ae31ac4cb492218eaf17205ed97e54236cf8760d55b6c33b4cd3f7dc
7
- data.tar.gz: fbe3e4a073f7f646438b07f1226e5c654a744c3efb421ea38b9c7b7adc5cf9e173fbab479780f765cc41f3c9144294d1ac16fe7f140e68bcdf44128a0bcafd68
6
+ metadata.gz: 60739ca5ec1d417e709792231bc06b65af4f6d2e6cac2a883a725bc5acd553d901a2d7c2d9b7da2e1a592f2f66635e740d668070a05551ffcfbefff3b4102dba
7
+ data.tar.gz: 6e34ef248fb441a9dcbdd60e4a2566e9010b01900b7802c33653e77744c9d7c9d33a65f78649118beb20bdc1fc283775232a7b834d4d514a3c8ea797d7698ee4
@@ -16,7 +16,7 @@ module ActiveRecord
16
16
 
17
17
  @#{kind} = timeout
18
18
  return unless materialized?
19
- connection.set(#{kind.inspect}, "\#{timeout}s", local: true)
19
+ connection.set(#{kind.inspect}, "\#{(timeout * 1000).to_i}ms", local: true)
20
20
  end
21
21
  RUBY
22
22
  end
@@ -25,7 +25,7 @@ module ActiveRecord
25
25
  PostgreSQLAdapter::TIMEOUTS.each do |kind|
26
26
  next if (timeout = send(kind, local: true)).nil?
27
27
 
28
- connection.set(kind, "#{timeout}s", local: true)
28
+ connection.set(kind, "#{(timeout * 1000).to_i}ms", local: true)
29
29
  end
30
30
  super
31
31
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module PGExtensions
5
- VERSION = "0.4.0"
5
+ VERSION = "0.4.1"
6
6
  end
7
7
  end
@@ -304,7 +304,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
304
304
  expect(connection.executed_statements).to eq(
305
305
  [
306
306
  "BEGIN",
307
- "SET LOCAL statement_timeout TO '30s'",
307
+ "SET LOCAL statement_timeout TO '30000ms'",
308
308
  "COMMIT"
309
309
  ]
310
310
  )
@@ -315,7 +315,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
315
315
  expect(connection.executed_statements).to eq(
316
316
  [
317
317
  "BEGIN",
318
- "SET LOCAL statement_timeout TO '5.5s'",
318
+ "SET LOCAL statement_timeout TO '5500ms'",
319
319
  "COMMIT"
320
320
  ]
321
321
  )
@@ -326,7 +326,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
326
326
  expect(connection.executed_statements).to eq(
327
327
  [
328
328
  "BEGIN",
329
- "SET LOCAL statement_timeout TO '5s'",
329
+ "SET LOCAL statement_timeout TO '5000ms'",
330
330
  "COMMIT"
331
331
  ]
332
332
  )
@@ -337,7 +337,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
337
337
  expect(connection.executed_statements).to eq(
338
338
  [
339
339
  "BEGIN",
340
- "SET LOCAL statement_timeout TO '30s'",
340
+ "SET LOCAL statement_timeout TO '30000ms'",
341
341
  "COMMIT"
342
342
  ]
343
343
  )
@@ -375,7 +375,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
375
375
  expect(connection.executed_statements).to eq(
376
376
  ["BEGIN",
377
377
  "SELECT 1",
378
- "SET LOCAL statement_timeout TO '30s'",
378
+ "SET LOCAL statement_timeout TO '30000ms'",
379
379
  "COMMIT"]
380
380
  )
381
381
  end
@@ -390,7 +390,7 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
390
390
 
391
391
  expect(connection.executed_statements).to eq(
392
392
  ["BEGIN",
393
- "SET LOCAL statement_timeout TO '30s'",
393
+ "SET LOCAL statement_timeout TO '30000ms'",
394
394
  "SELECT 1",
395
395
  "COMMIT"]
396
396
  )
@@ -410,9 +410,9 @@ describe ActiveRecord::ConnectionAdapters::PostgreSQLAdapter do
410
410
 
411
411
  expect(connection.executed_statements).to eq(
412
412
  ["BEGIN",
413
- "SET LOCAL statement_timeout TO '30s'",
413
+ "SET LOCAL statement_timeout TO '30000ms'",
414
414
  "SAVEPOINT active_record_1",
415
- "SET LOCAL statement_timeout TO '15s'",
415
+ "SET LOCAL statement_timeout TO '15000ms'",
416
416
  "SELECT 1",
417
417
  "RELEASE SAVEPOINT active_record_1",
418
418
  "COMMIT"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-pg-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer