web47core 1.0.7 → 1.0.13
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/app/helpers/core_form_helper.rb +2 -2
- data/lib/app/controllers/concerns/core_delayed_jobs_controller.rb +1 -1
- data/lib/app/jobs/cron/server.rb +1 -1
- data/lib/app/jobs/cron/trim_collection.rb +8 -1
- data/lib/app/models/concerns/encrypted_password.rb +3 -3
- data/lib/app/models/concerns/standard_model.rb +1 -0
- data/lib/app/models/user_model_audit_log.rb +1 -0
- data/lib/web47core/version.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: 64f54ec070076d76e56d136ae5591375af7fef5de343ace173a968d960944b72
|
4
|
+
data.tar.gz: 0ad4b7661dabd9358bc09cbfbe2f61b83fec4f59eac5d98257363e42796a3b38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 812533c9e7612635e8646d144582388489cc34e91dd1682adcbc39ec698cec27f8788553d7a60eb18de139b6be5d7746b3525514152910ee382cd7942c35e9c8
|
7
|
+
data.tar.gz: b732ba4c2b1fd46e3e769aefb57ca346e8527049885ecf22988963df5b10c1c6379a4da1f01d0a2a70fa6ab38354d32f3ac10af2411e85572215e89d855dd6e3
|
@@ -21,12 +21,12 @@ module CoreFormHelper
|
|
21
21
|
# tag_options = {class: []} # text_field_options(model, field, options)
|
22
22
|
# tag_options[:class] += ['materialize-textarea']
|
23
23
|
content_tag(:div, class: (%w[input-field col] + classes).join(' ')) do
|
24
|
-
concat(
|
24
|
+
concat(text_area_tag(model, field, value, options))
|
25
25
|
concat(form_label_tag(model, field, value, options))
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
29
|
+
def text_area_tag(model, field, value, options = {})
|
30
30
|
tag_options = text_field_options(model, field, options)
|
31
31
|
tag_options[:class] += ['materialize-textarea']
|
32
32
|
content_tag(:textarea, tag_options) do
|
@@ -10,7 +10,7 @@ module CoreDelayedJobsController
|
|
10
10
|
#
|
11
11
|
def index
|
12
12
|
authorize! :read, Delayed::Backend::Mongoid::Job
|
13
|
-
@delayed_jobs = Delayed::Backend::Mongoid::Job.asc(%i[priority run_at]).limit(100)
|
13
|
+
@delayed_jobs = Delayed::Backend::Mongoid::Job.asc(%i[locked_by priority run_at]).limit(100)
|
14
14
|
end
|
15
15
|
|
16
16
|
def show
|
data/lib/app/jobs/cron/server.rb
CHANGED
@@ -185,7 +185,7 @@ module Cron
|
|
185
185
|
# Returns the AutoScalingGroup associated with the account
|
186
186
|
#
|
187
187
|
def auto_scaling_group
|
188
|
-
filter = { auto_scaling_group_names: [sys_config.
|
188
|
+
filter = { auto_scaling_group_names: [sys_config.aws_auto_scaling_group_name] }
|
189
189
|
@auto_scaling_group ||= client.describe_auto_scaling_groups(filter).auto_scaling_groups.first
|
190
190
|
end
|
191
191
|
|
@@ -31,12 +31,19 @@ module Cron
|
|
31
31
|
# Test if this should be archived
|
32
32
|
#
|
33
33
|
def archive?(item)
|
34
|
-
item.
|
34
|
+
item.send(comparison_field) < allowed_time_for_item(item)
|
35
35
|
rescue StandardError => error
|
36
36
|
App47Logger.log_warn "Unable to archive item #{item.inspect}", error
|
37
37
|
false
|
38
38
|
end
|
39
39
|
|
40
|
+
#
|
41
|
+
# Return which field to use for comparison when trimming objects
|
42
|
+
#
|
43
|
+
def comparison_field
|
44
|
+
:updated_at
|
45
|
+
end
|
46
|
+
|
40
47
|
#
|
41
48
|
# Try to get a TTL from System configuration, otherwise return the default
|
42
49
|
#
|
@@ -23,7 +23,7 @@ module EncryptedPassword
|
|
23
23
|
# Retrieve the password
|
24
24
|
#
|
25
25
|
def password
|
26
|
-
cipher.decrypt_and_verify(encrypted_password)
|
26
|
+
encrypted_password.present? ? cipher.decrypt_and_verify(encrypted_password) : ''
|
27
27
|
rescue StandardError => error
|
28
28
|
App47Logger.log_warn("Unable to retrieve password for #{inspect}", error)
|
29
29
|
nil
|
@@ -32,8 +32,8 @@ module EncryptedPassword
|
|
32
32
|
#
|
33
33
|
# Set the password
|
34
34
|
#
|
35
|
-
def password=(
|
36
|
-
set encrypted_password: cipher.encrypt_and_sign(
|
35
|
+
def password=(pass)
|
36
|
+
set encrypted_password: cipher.encrypt_and_sign(pass)
|
37
37
|
rescue StandardError => error
|
38
38
|
App47Logger.log_error("Unable to store password for #{inspect}", error)
|
39
39
|
nil
|
@@ -312,6 +312,7 @@ module StandardModel
|
|
312
312
|
#
|
313
313
|
def log_deletion(user, model)
|
314
314
|
Web47core::Config.audit_model_log_class.create!(Web47core::Config.audit_model => user,
|
315
|
+
deleted_oid: model.id,
|
315
316
|
model: model,
|
316
317
|
action: AuditLog::DELETE_ACTION,
|
317
318
|
changed_values: App47Logger.clean_params(attributes).to_json)
|
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: 1.0.
|
4
|
+
version: 1.0.13
|
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-
|
11
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|