web47core 0.9.7 → 1.0.2
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 +4 -4
- data/README.md +14 -0
- data/app/helpers/core_link_helper.rb +1 -1
- data/app/helpers/model_modal_helper.rb +1 -1
- data/app/views/delayed_jobs/_index.html.haml +1 -1
- data/app/views/delayed_jobs/_show.html.haml +1 -1
- data/lib/app/models/concerns/secure_fields.rb +41 -0
- data/lib/web47core.rb +1 -0
- data/lib/web47core/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e37f203836b0061d6a6a7be17633c998689e37fe15a29f90fca9878efba6996
|
4
|
+
data.tar.gz: fc0b0bb51d21ba1813ed55be1e0963949f746e79c9d1ade65671c126494a260b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71cf329a809153b71e79db8da135d30ae37fd29f2f041d22bfe4867ea73db07b5bddf5de7b2dc9a70dbed5458b6e80bf39897e9148b767dfbf2e6ac885a5b076
|
7
|
+
data.tar.gz: 6dc57e63cb0cef59aae8996424ab85bd93b90a885d9e69e6ca13a07dedc24873d90616ad0f753c3239cfab13209bb54acf3d61922aab33d0397dda3c95f3f527
|
data/README.md
CHANGED
@@ -88,6 +88,7 @@ _Please do not ship to production code using the git repo, as the production ser
|
|
88
88
|
17. `CronJobServer` and `CronJobServerTest`
|
89
89
|
18. `JobCronTab` and `JobCronTabTest`
|
90
90
|
19. `CronTab`
|
91
|
+
20. `SecureFields`
|
91
92
|
|
92
93
|
#### Models
|
93
94
|
##### Concerns
|
@@ -145,6 +146,7 @@ Before starting the server, you need to run the database command
|
|
145
146
|
```mongo
|
146
147
|
db.cron_tabs.updateMany({_type: 'JobCronTab'}, {$set: {_type: 'Cron::JobTab'}});
|
147
148
|
```
|
149
|
+
|
148
150
|
#### Routes
|
149
151
|
Update abilities to new class names
|
150
152
|
CronTab, JobCronTab, CronJobServer to Cron::Tab, Cron::JobTab, Cron::Server
|
@@ -200,6 +202,12 @@ class CronController < AdminController
|
|
200
202
|
rescue_from Mongoid::Errors::DocumentNotFound, with: :document_not_found_error
|
201
203
|
end
|
202
204
|
```
|
205
|
+
|
206
|
+
To start or stop the cron server, run the bundler command:
|
207
|
+
```
|
208
|
+
bundle exec cron_server start|stop
|
209
|
+
```
|
210
|
+
|
203
211
|
##### DelayedJobController
|
204
212
|
Update the DelayedJobController with something like below, and remove the views and any localization you might have made.
|
205
213
|
```ruby
|
@@ -214,6 +222,12 @@ class DelayedJobsController < AdminController
|
|
214
222
|
rescue_from Mongoid::Errors::DocumentNotFound, with: :document_not_found_error
|
215
223
|
end
|
216
224
|
```
|
225
|
+
|
226
|
+
To start or stop the delayed jobs, run the bundler command:
|
227
|
+
```
|
228
|
+
bundle exec delayed_job start|stop
|
229
|
+
```
|
230
|
+
|
217
231
|
##### StatusController
|
218
232
|
Remove controller, views and localizations
|
219
233
|
##### SystemConfigurationsController
|
@@ -40,7 +40,7 @@ module CoreLinkHelper
|
|
40
40
|
# Add the table action button and setup the drop down
|
41
41
|
#
|
42
42
|
def table_action_button(action_id, icon_name = 'more_horiz')
|
43
|
-
datum = {
|
43
|
+
datum = { target: action_id,
|
44
44
|
constrainWidth: false,
|
45
45
|
gutter: 28,
|
46
46
|
alignment: 'right' }
|
@@ -160,7 +160,7 @@ module ModelModalHelper
|
|
160
160
|
end
|
161
161
|
|
162
162
|
def model_modal_standard(model, _options = {})
|
163
|
-
content_tag(:table, class: 'center-align
|
163
|
+
content_tag(:table, class: 'center-align highlight') do
|
164
164
|
concat(content_tag(:tbody) do
|
165
165
|
%w[_id _type created_at updated_at search_text sort_text].each do |field_name|
|
166
166
|
concat(model_modal_field(model, field_name))
|
@@ -34,7 +34,7 @@
|
|
34
34
|
.container
|
35
35
|
.row
|
36
36
|
.col.s12
|
37
|
-
%table.
|
37
|
+
%table.highlight.bordered.extended{data: {sort: {column: 'Run At,Priority', direction: 'desc,asc'}}}
|
38
38
|
%thead
|
39
39
|
%tr
|
40
40
|
%th=t('.run_at')
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# A mixin for models with secure fields.
|
5
|
+
# Basically if the secure field is blank, nil or "", then delete it from the update.
|
6
|
+
#
|
7
|
+
module SecureFields
|
8
|
+
extend ActiveSupport::Concern
|
9
|
+
#
|
10
|
+
# Remove updates for secure fields
|
11
|
+
#
|
12
|
+
def update(params)
|
13
|
+
super(filter_secure_fields(params))
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# Remove updates for secure fields
|
18
|
+
#
|
19
|
+
def update!(params)
|
20
|
+
super(filter_secure_fields(params))
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# Remove updates for secure fields
|
25
|
+
#
|
26
|
+
def assign_attributes(params)
|
27
|
+
super(filter_secure_fields(params))
|
28
|
+
end
|
29
|
+
|
30
|
+
#
|
31
|
+
# List of secure fields
|
32
|
+
#
|
33
|
+
def secure_fields
|
34
|
+
[]
|
35
|
+
end
|
36
|
+
|
37
|
+
def filter_secure_fields(params)
|
38
|
+
secure_fields.each { |field| params.delete(field) if params[field].blank? }
|
39
|
+
params
|
40
|
+
end
|
41
|
+
end
|
data/lib/web47core.rb
CHANGED
@@ -9,6 +9,7 @@ require 'app/models/concerns/standard_model'
|
|
9
9
|
require 'app/models/concerns/switchboard_able'
|
10
10
|
require 'app/models/concerns/core_system_configuration'
|
11
11
|
require 'app/models/concerns/core_account'
|
12
|
+
require 'app/models/concerns/secure_fields'
|
12
13
|
require 'app/models/delayed_job'
|
13
14
|
require 'app/models/redis_configuration'
|
14
15
|
require 'app/models/notification'
|
data/lib/web47core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web47core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Schroeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -636,6 +636,7 @@ files:
|
|
636
636
|
- lib/app/models/concerns/email_able.rb
|
637
637
|
- lib/app/models/concerns/role_able.rb
|
638
638
|
- lib/app/models/concerns/search_able.rb
|
639
|
+
- lib/app/models/concerns/secure_fields.rb
|
639
640
|
- lib/app/models/concerns/standard_model.rb
|
640
641
|
- lib/app/models/concerns/switchboard_able.rb
|
641
642
|
- lib/app/models/concerns/time_zone_able.rb
|