pg_saurus 3.1.1 → 3.2.0
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 415fc5db55968776ea027a80129efaf2585a3bb5
|
|
4
|
+
data.tar.gz: 907c71a922cd7e21c438b404703fef26caa68c59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94678878deef5dfbd673f11a88c9395f0f6567398bf5275d80253736675c8ab4968be491c3fc65b037c2ff5c6d99cf5801260ab0d77315d7dd8860a4a16f64d6
|
|
7
|
+
data.tar.gz: a822d5f047b7d424284d24fb159b2b0acd27c5fe1deb5548075ab711196d272892392e7b9cd85055549f52b823a4e4757edaf6dfc158611db15c78a323c083d5
|
|
@@ -4,13 +4,13 @@ module PgSaurus::ConnectionAdapters::PostgreSQLAdapter::TranslateException
|
|
|
4
4
|
# # See http://www.postgresql.org/docs/9.1/static/errcodes-appendix.html
|
|
5
5
|
INSUFFICIENT_PRIVILEGE = "42501"
|
|
6
6
|
|
|
7
|
-
# Intercept insufficient privilege
|
|
7
|
+
# Intercept insufficient privilege PG::Error and raise active_record wrapped database exception
|
|
8
8
|
def translate_exception(exception, message)
|
|
9
9
|
exception_result = exception.result
|
|
10
10
|
|
|
11
|
-
case exception_result.try(:error_field,
|
|
11
|
+
case exception_result.try(:error_field, PG::Result::PG_DIAG_SQLSTATE)
|
|
12
12
|
when INSUFFICIENT_PRIVILEGE
|
|
13
|
-
exc_message = exception_result.try(:error_field,
|
|
13
|
+
exc_message = exception_result.try(:error_field, PG::Result::PG_DIAG_MESSAGE_PRIMARY)
|
|
14
14
|
exc_message ||= message
|
|
15
15
|
::ActiveRecord::InsufficientPrivilege.new(exc_message, exception)
|
|
16
16
|
else
|
data/lib/pg_saurus/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pg_saurus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Potapov Sergey
|
|
@@ -13,7 +13,7 @@ authors:
|
|
|
13
13
|
autorequire:
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
|
-
date: 2017-
|
|
16
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: pg
|