activerecord-postgresql-extensions 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20a8f5a52e70f2af6ab1cedf38917ad34062b99d
|
4
|
+
data.tar.gz: 6711b30dcc29cc0a7caac8834c92c99629617845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e5975fb6a7986f0b20a4d176bf591602388bb1d45a3d7fe6fcfdfe3e0c580d46d59c2d4d72b5642b5f742bc3788858406a090d464508bd1f5204a54b2330133
|
7
|
+
data.tar.gz: dc10116eaa8817788546e12583089a62dd00e858794bbbc3e2628ff3a2435aa68d558903f13316212fd53d339f235d1d3650c6440146fba8ffb9b07e241269cd
|
data/MIT-LICENSE
CHANGED
@@ -443,7 +443,11 @@ module ActiveRecord
|
|
443
443
|
end
|
444
444
|
|
445
445
|
def current_role
|
446
|
-
execute('SELECT current_role;')
|
446
|
+
current_role = execute('SELECT current_role;').try(:first)
|
447
|
+
|
448
|
+
if current_role
|
449
|
+
current_role['current_user']
|
450
|
+
end
|
447
451
|
end
|
448
452
|
alias :current_user :current_role
|
449
453
|
|
@@ -71,13 +71,20 @@ class AdapterExtensionTests < PostgreSQLExtensionsTestCase
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def test_current_role
|
74
|
-
ARBC.
|
75
|
-
|
74
|
+
ARBC.real_execute do
|
75
|
+
current_role = ARBC.current_role
|
76
|
+
current_user = ARBC.current_user
|
76
77
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
78
|
+
assert_equal([
|
79
|
+
'SELECT current_role;',
|
80
|
+
'SELECT current_role;'
|
81
|
+
], statements)
|
82
|
+
|
83
|
+
real_user = ARBC.execute('SELECT current_role;').first['current_user']
|
84
|
+
|
85
|
+
assert_equal(real_user, current_user);
|
86
|
+
assert_equal(real_user, current_role);
|
87
|
+
end
|
81
88
|
end
|
82
89
|
|
83
90
|
def test_enable_triggers
|
metadata
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-postgresql-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- J Smith
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: activerecord
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '2.3'
|
20
|
-
|
19
|
+
name: activerecord
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
@@ -94,7 +94,7 @@ homepage: http://github.com/zoocasa/activerecord-postgresql-extensions
|
|
94
94
|
licenses:
|
95
95
|
- MIT
|
96
96
|
metadata: {}
|
97
|
-
post_install_message:
|
97
|
+
post_install_message:
|
98
98
|
rdoc_options: []
|
99
99
|
require_paths:
|
100
100
|
- lib
|
@@ -109,9 +109,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
|
-
rubyforge_project:
|
113
|
-
rubygems_version: 2.4.
|
114
|
-
signing_key:
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.4.8
|
114
|
+
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: A whole bunch of extensions the ActiveRecord PostgreSQL adapter.
|
117
117
|
test_files:
|