care 0.1.0 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +65 -66
- data/lib/care/auto_finder/searchable.rb +2 -1
- data/lib/care/seed.rb +7 -5
- data/lib/care/support/authorization_helper.rb +2 -1
- data/lib/care/support/parameters.rb +1 -1
- data/lib/care/version.rb +1 -1
- data/lib/patch/action_controller/concerns/authorization.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0d173cca687ef272ba0759ff347995723a34052af354aa01a22fac55614bbd9
|
4
|
+
data.tar.gz: f4975d1110fe9eed49cb1e1964a716be88d78fb012faba92472576371bfa7658
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db5fac70a2cf214bf2294077411da7924f6c25c6dd3b458d48eab4338cbbe4cf2a20fe5e37f69e55c9c9992fa28e3e319d7b2c33fdfccf3827bf99a78909a244
|
7
|
+
data.tar.gz: c8f3cd3169d948c88a1ec55fefc14fab39c74eed92e564e46e51e62dfcef832b72b7819d0da03888f7915592da59dda0c7ba1ea147553307c34d88de9e78eff5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
care (0.1.
|
4
|
+
care (0.1.6)
|
5
5
|
active_model_serializers (~> 0.10.10)
|
6
6
|
activerecord-import
|
7
7
|
cancancan
|
@@ -19,49 +19,48 @@ PATH
|
|
19
19
|
GEM
|
20
20
|
remote: https://rubygems.org/
|
21
21
|
specs:
|
22
|
-
actionpack (
|
23
|
-
actionview (=
|
24
|
-
activesupport (=
|
25
|
-
rack (~> 2.0, >= 2.0.
|
22
|
+
actionpack (6.1.0)
|
23
|
+
actionview (= 6.1.0)
|
24
|
+
activesupport (= 6.1.0)
|
25
|
+
rack (~> 2.0, >= 2.0.9)
|
26
26
|
rack-test (>= 0.6.3)
|
27
27
|
rails-dom-testing (~> 2.0)
|
28
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
29
|
-
actionview (
|
30
|
-
activesupport (=
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
29
|
+
actionview (6.1.0)
|
30
|
+
activesupport (= 6.1.0)
|
31
31
|
builder (~> 3.1)
|
32
32
|
erubi (~> 1.4)
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
|
-
rails-html-sanitizer (~> 1.
|
35
|
-
active_model_serializers (0.10.
|
36
|
-
actionpack (>= 4.1, < 6.
|
37
|
-
activemodel (>= 4.1, < 6.
|
34
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
35
|
+
active_model_serializers (0.10.12)
|
36
|
+
actionpack (>= 4.1, < 6.2)
|
37
|
+
activemodel (>= 4.1, < 6.2)
|
38
38
|
case_transform (>= 0.2)
|
39
39
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
40
|
-
activemodel (
|
41
|
-
activesupport (=
|
42
|
-
activerecord (
|
43
|
-
activemodel (=
|
44
|
-
activesupport (=
|
45
|
-
arel (>= 9.0)
|
40
|
+
activemodel (6.1.0)
|
41
|
+
activesupport (= 6.1.0)
|
42
|
+
activerecord (6.1.0)
|
43
|
+
activemodel (= 6.1.0)
|
44
|
+
activesupport (= 6.1.0)
|
46
45
|
activerecord-import (1.0.7)
|
47
46
|
activerecord (>= 3.2)
|
48
|
-
activesupport (
|
47
|
+
activesupport (6.1.0)
|
49
48
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
50
|
-
i18n (>=
|
51
|
-
minitest (
|
52
|
-
tzinfo (~>
|
53
|
-
|
49
|
+
i18n (>= 1.6, < 2)
|
50
|
+
minitest (>= 5.1)
|
51
|
+
tzinfo (~> 2.0)
|
52
|
+
zeitwerk (~> 2.3)
|
54
53
|
ast (2.4.1)
|
55
54
|
bcrypt (3.1.16)
|
56
55
|
builder (3.2.4)
|
57
|
-
cancancan (3.
|
56
|
+
cancancan (3.2.0)
|
58
57
|
case_transform (0.2)
|
59
58
|
activesupport
|
60
59
|
centrifuge (1.2.0)
|
61
60
|
httpclient
|
62
61
|
multi_json
|
63
|
-
concurrent-ruby (1.1.
|
64
|
-
crass (1.0.
|
62
|
+
concurrent-ruby (1.1.7)
|
63
|
+
crass (1.0.6)
|
65
64
|
database_cleaner (1.8.5)
|
66
65
|
database_cleaner-active_record (1.8.0)
|
67
66
|
activerecord
|
@@ -77,46 +76,46 @@ GEM
|
|
77
76
|
dotenv-rails (2.7.6)
|
78
77
|
dotenv (= 2.7.6)
|
79
78
|
railties (>= 3.2)
|
80
|
-
erubi (1.
|
79
|
+
erubi (1.10.0)
|
81
80
|
factory_bot (5.2.0)
|
82
81
|
activesupport (>= 4.2.0)
|
83
82
|
factory_bot_rails (5.2.0)
|
84
83
|
factory_bot (~> 5.2.0)
|
85
84
|
railties (>= 4.2.0)
|
86
|
-
faker (2.
|
85
|
+
faker (2.15.1)
|
87
86
|
i18n (>= 1.6, < 2)
|
88
87
|
httpclient (2.8.3)
|
89
|
-
i18n (1.
|
88
|
+
i18n (1.8.5)
|
90
89
|
concurrent-ruby (~> 1.0)
|
91
90
|
jsonapi-renderer (0.2.2)
|
92
91
|
jwt (2.2.2)
|
93
|
-
kaminari (1.
|
92
|
+
kaminari (1.2.1)
|
94
93
|
activesupport (>= 4.1.0)
|
95
|
-
kaminari-actionview (= 1.
|
96
|
-
kaminari-activerecord (= 1.
|
97
|
-
kaminari-core (= 1.
|
98
|
-
kaminari-actionview (1.
|
94
|
+
kaminari-actionview (= 1.2.1)
|
95
|
+
kaminari-activerecord (= 1.2.1)
|
96
|
+
kaminari-core (= 1.2.1)
|
97
|
+
kaminari-actionview (1.2.1)
|
99
98
|
actionview
|
100
|
-
kaminari-core (= 1.
|
101
|
-
kaminari-activerecord (1.
|
99
|
+
kaminari-core (= 1.2.1)
|
100
|
+
kaminari-activerecord (1.2.1)
|
102
101
|
activerecord
|
103
|
-
kaminari-core (= 1.
|
104
|
-
kaminari-core (1.
|
105
|
-
loofah (2.
|
102
|
+
kaminari-core (= 1.2.1)
|
103
|
+
kaminari-core (1.2.1)
|
104
|
+
loofah (2.8.0)
|
106
105
|
crass (~> 1.0.2)
|
107
106
|
nokogiri (>= 1.5.9)
|
108
107
|
method_source (1.0.0)
|
109
108
|
mini_portile2 (2.4.0)
|
110
|
-
minitest (5.
|
109
|
+
minitest (5.14.2)
|
111
110
|
multi_json (1.15.0)
|
112
|
-
nokogiri (1.10.
|
111
|
+
nokogiri (1.10.10)
|
113
112
|
mini_portile2 (~> 2.4.0)
|
114
113
|
orm_adapter (0.5.0)
|
115
|
-
parallel (1.
|
114
|
+
parallel (1.20.1)
|
116
115
|
parser (2.7.2.0)
|
117
116
|
ast (~> 2.4.1)
|
118
117
|
prometheus-client (1.0.0)
|
119
|
-
rack (2.
|
118
|
+
rack (2.2.3)
|
120
119
|
rack-test (1.1.0)
|
121
120
|
rack (>= 1.0, < 3)
|
122
121
|
rails-dom-testing (2.0.3)
|
@@ -124,31 +123,31 @@ GEM
|
|
124
123
|
nokogiri (>= 1.6)
|
125
124
|
rails-html-sanitizer (1.3.0)
|
126
125
|
loofah (~> 2.3)
|
127
|
-
railties (
|
128
|
-
actionpack (=
|
129
|
-
activesupport (=
|
126
|
+
railties (6.1.0)
|
127
|
+
actionpack (= 6.1.0)
|
128
|
+
activesupport (= 6.1.0)
|
130
129
|
method_source
|
131
130
|
rake (>= 0.8.7)
|
132
|
-
thor (
|
131
|
+
thor (~> 1.0)
|
133
132
|
rainbow (3.0.0)
|
134
|
-
rake (13.0.
|
135
|
-
regexp_parser (
|
133
|
+
rake (13.0.3)
|
134
|
+
regexp_parser (2.0.1)
|
136
135
|
responders (3.0.1)
|
137
136
|
actionpack (>= 5.0)
|
138
137
|
railties (>= 5.0)
|
139
138
|
rexml (3.2.4)
|
140
|
-
rspec (3.
|
141
|
-
rspec-core (~> 3.
|
142
|
-
rspec-expectations (~> 3.
|
143
|
-
rspec-mocks (~> 3.
|
144
|
-
rspec-core (3.
|
145
|
-
rspec-support (~> 3.
|
146
|
-
rspec-expectations (3.
|
139
|
+
rspec (3.10.0)
|
140
|
+
rspec-core (~> 3.10.0)
|
141
|
+
rspec-expectations (~> 3.10.0)
|
142
|
+
rspec-mocks (~> 3.10.0)
|
143
|
+
rspec-core (3.10.0)
|
144
|
+
rspec-support (~> 3.10.0)
|
145
|
+
rspec-expectations (3.10.0)
|
147
146
|
diff-lcs (>= 1.2.0, < 2.0)
|
148
|
-
rspec-support (~> 3.
|
149
|
-
rspec-mocks (3.
|
147
|
+
rspec-support (~> 3.10.0)
|
148
|
+
rspec-mocks (3.10.0)
|
150
149
|
diff-lcs (>= 1.2.0, < 2.0)
|
151
|
-
rspec-support (~> 3.
|
150
|
+
rspec-support (~> 3.10.0)
|
152
151
|
rspec-rails (4.0.1)
|
153
152
|
actionpack (>= 4.2)
|
154
153
|
activesupport (>= 4.2)
|
@@ -157,7 +156,7 @@ GEM
|
|
157
156
|
rspec-expectations (~> 3.9)
|
158
157
|
rspec-mocks (~> 3.9)
|
159
158
|
rspec-support (~> 3.9)
|
160
|
-
rspec-support (3.
|
159
|
+
rspec-support (3.10.0)
|
161
160
|
rubocop (0.93.1)
|
162
161
|
parallel (~> 1.10)
|
163
162
|
parser (>= 2.7.1.5)
|
@@ -167,18 +166,18 @@ GEM
|
|
167
166
|
rubocop-ast (>= 0.6.0)
|
168
167
|
ruby-progressbar (~> 1.7)
|
169
168
|
unicode-display_width (>= 1.4.0, < 2.0)
|
170
|
-
rubocop-ast (
|
169
|
+
rubocop-ast (1.3.0)
|
171
170
|
parser (>= 2.7.1.5)
|
172
171
|
ruby-progressbar (1.10.1)
|
173
172
|
shoulda-matchers (4.4.1)
|
174
173
|
activesupport (>= 4.2.0)
|
175
174
|
thor (1.0.1)
|
176
|
-
|
177
|
-
|
178
|
-
thread_safe (~> 0.1)
|
175
|
+
tzinfo (2.0.4)
|
176
|
+
concurrent-ruby (~> 1.0)
|
179
177
|
unicode-display_width (1.7.0)
|
180
|
-
warden (1.2.
|
181
|
-
rack (>= 2.0.
|
178
|
+
warden (1.2.9)
|
179
|
+
rack (>= 2.0.9)
|
180
|
+
zeitwerk (2.4.2)
|
182
181
|
|
183
182
|
PLATFORMS
|
184
183
|
ruby
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require_relative 'searcher'
|
2
3
|
|
3
4
|
module Care::AutoFinder
|
4
5
|
#
|
@@ -25,7 +26,7 @@ module Care::AutoFinder
|
|
25
26
|
|
26
27
|
def search(items)
|
27
28
|
if params[:search].present?
|
28
|
-
Searcher.call(items: items, columns: columns, search: params[:search])
|
29
|
+
Care::AutoFinder::Searcher.call(items: items, columns: columns, search: params[:search])
|
29
30
|
else
|
30
31
|
items
|
31
32
|
end
|
data/lib/care/seed.rb
CHANGED
@@ -5,13 +5,15 @@ module Care
|
|
5
5
|
table_name = path.split("/").last.gsub(".json", "").gsub(/^\d*_/, "")
|
6
6
|
puts "*** Преднаполнение таблицы #{table_name} ***"
|
7
7
|
items = ActiveSupport::JSON.decode(File.read(path))
|
8
|
-
|
9
|
-
|
8
|
+
table_name = table_name.gsub('dictionary_', 'dictionary/') || table_name
|
9
|
+
if (items_class = table_name.classify.safe_constantize)
|
10
10
|
items_class.import(items, on_duplicate_key_update: :all)
|
11
|
-
|
12
|
-
keys = items[0].keys
|
11
|
+
else
|
12
|
+
keys = items[0].keys
|
13
|
+
v_keys = keys.join(",")
|
13
14
|
values = items.map { |i| "(#{i.values.map { |v| "'#{v}'" }.join(",")})" }.join(",")
|
14
|
-
|
15
|
+
set_keys = keys.map{|k| "#{k} = excluded.#{k}"}.join(", ")
|
16
|
+
sql = "insert into #{table_name}(#{v_keys}) values #{values} on conflict (id) do update set #{set_keys}"
|
15
17
|
puts sql
|
16
18
|
ActiveRecord::Base.connection.execute sql
|
17
19
|
end
|
@@ -9,7 +9,7 @@ RSpec.shared_context "parameters" do |parameter_tags|
|
|
9
9
|
required: true
|
10
10
|
end
|
11
11
|
if parameter_tags.include?(:organization_id)
|
12
|
-
parameter name: :
|
12
|
+
parameter name: :'Organization-Id',
|
13
13
|
description: "Organization ID текущей организации",
|
14
14
|
in: :header,
|
15
15
|
type: :string,
|
data/lib/care/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: care
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Валерий Маханов
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|