create_custom_attributes 0.5.23 → 0.5.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/custom_attributes.rb +12 -2
- data/lib/custom_attributes/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05a8198fbc2cce5bbbd6f04e176b7185fcfb0076
|
4
|
+
data.tar.gz: 4af787babaaea1d564c7238b7e8669772153ecd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cd13b036d2ce5280b34d75590592df4bbf3351364f2a5b6e933e43a1b84ebd10c04f44962324f9512949bb15f7867414538b7668e0574de9efbdea83f8b3685
|
7
|
+
data.tar.gz: 949c544b636f033e569a215d4396139310fdcf2483deb573f837b650dd3c8211aea2372714a4cd858d960856956c2083cb82b09a140f06cb98689d2620bd2a10
|
data/lib/custom_attributes.rb
CHANGED
@@ -28,7 +28,7 @@ module CustomAttributes
|
|
28
28
|
@config = {
|
29
29
|
search_user: ENV["ELASTICSEARCH_USER"] || 'elastic',
|
30
30
|
search_pass: ENV["ELASTICSEARCH_PASSWORD"] || 'changeme',
|
31
|
-
search_host: ENV["ELASTICSEARCH_HOST"] || 'localhost:9200',
|
31
|
+
search_host: ENV["ELASTICSEARCH_HOST"] || 'http://localhost:9200',
|
32
32
|
search_index_prefix: ENV["ELASTICSEARCH_INDEX_PREFIX"] || 'es'
|
33
33
|
}
|
34
34
|
|
@@ -47,6 +47,16 @@ module CustomAttributes
|
|
47
47
|
|
48
48
|
def self.after_configuration
|
49
49
|
# Set up ElasticSearch
|
50
|
-
|
50
|
+
uri = URI(@config[:search_host])
|
51
|
+
|
52
|
+
if @config[:search_user].present? && @config[:search_pass].present?
|
53
|
+
host = "#{uri.scheme}://#{@config[:search_user]}:#{@config[:search_pass]}@#{uri.host}"
|
54
|
+
else
|
55
|
+
host = uri.host
|
56
|
+
end
|
57
|
+
|
58
|
+
host = "#{host}:#{uri.port}" if uri.port.present?
|
59
|
+
|
60
|
+
Elasticsearch::Model.client = Elasticsearch::Client.new host: host
|
51
61
|
end
|
52
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: create_custom_attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Grützmacher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|