sequel-search-path 0.3.0 → 0.3.1

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
- SHA1:
3
- metadata.gz: ed49e29014d6fa5578ac2253041067f8a6a701db
4
- data.tar.gz: 6f00b638ea55e6746377798e324f602668678fe8
2
+ SHA256:
3
+ metadata.gz: 974ce1e8ff45a17c3d4475f34bd2dbe71c1adcc264a9d7e52d2a65ef773bff5a
4
+ data.tar.gz: e97263155da8128836f9ea1afeb645828c689d8e859692179afd76aabdc1367a
5
5
  SHA512:
6
- metadata.gz: 081d241e69e1e55f51f47e50f2a9425faf0156d7e9735836cc693494f416e65c9a3d22edb7eee7e5da8f644ea0921ae14dd6c128a07af53460114270440f2658
7
- data.tar.gz: 50dc8212afb4899ad26a37ce770cb50256aa9d39b6d8627899cfb29fcd5ded5e49e587947739c023ca1b51c7e629e0547bde1bf0eb6112dabbd7eff01e472038
6
+ metadata.gz: 1316a214b9b40187bb510bbb5cd0cee74ca5d2c7f820b036a2545005eb9749d16975c52843b4426c2022faf218a2c48236e5c4adeeab194acdd4bdd0a37ebfc6
7
+ data.tar.gz: e5b21265755ed63d329c9ea48784f36a7102e4c1431884846b2863662a7b7077db0f9ac9d70ead50dce5c679e0302bf420287bd8af161db44e6886623731cf4f
@@ -22,7 +22,7 @@ module Sequel
22
22
  end
23
23
 
24
24
  def schemas
25
- Thread.current[schemas_key] ||= [:public]
25
+ Thread.current[schemas_key] ||= parse_search_path
26
26
  end
27
27
 
28
28
  def schemas=(new_schemas)
@@ -57,6 +57,14 @@ module Sequel
57
57
 
58
58
  private
59
59
 
60
+ def parse_search_path
61
+ search_path.
62
+ split(/[\s,]+/).
63
+ map{|s| s.gsub(/\A"|"\z/, '')}.
64
+ reject{|s| s == '$user'}.
65
+ map(&:to_sym)
66
+ end
67
+
60
68
  def set_search_path(schemas)
61
69
  placeholders = schemas.map{'?'}.join(', ')
62
70
  placeholders = "''" if placeholders.empty?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sequel
4
4
  module SearchPath
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-search-path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hanks
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-05 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.5.1
137
+ rubygems_version: 2.7.3
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Easy scoping of Postgres' search_path for Sequel