web47core 0.9.8 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/app/helpers/core_link_helper.rb +1 -1
- data/lib/app/jobs/cron/job_tab.rb +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: 2b4f72b9f26745f8ec3e9271900bb50d375b1e77e6a24fdcd459e12c7903778d
|
4
|
+
data.tar.gz: c4e966240c8255ffb06cdcf5bffd743481eb340f84691c8d83453a10d19ac8f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2f1c2d5c5f0be9902a6b0f26065222bba5c7c7f2b932428ef1d2294fdb6ee028038de1826d88f58a67e8606f91130e5745de808e1bc0660a8ed118aae726bca
|
7
|
+
data.tar.gz: 95f9fa0eb72cd0d1d292d1677a3b782d5547e38fca617a96c1f1fe9a7f0291a145d8b44baefbedaf41c15e56d7f89bc8be46ca3df660f753a77d1e278e40fe7f
|
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' }
|
@@ -38,7 +38,7 @@ module Cron
|
|
38
38
|
def job_names
|
39
39
|
@job_names ||= all_jobs.collect do |job|
|
40
40
|
job_name = job.to_s
|
41
|
-
next if FRAMEWORK_CLASSES.include?(job_name) || job_name.end_with?('
|
41
|
+
next if FRAMEWORK_CLASSES.include?(job_name) || job_name.end_with?('_test') || job_name.start_with?('base_')
|
42
42
|
|
43
43
|
job_name.underscore
|
44
44
|
end.compact
|
@@ -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.3
|
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
|