web47core 1.0.7 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e47d367b65524e64ca9fdfe7a20cd32913601f00e65cde6dd64b123731de01c
4
- data.tar.gz: 82673c3c6a38c473e6207d14cbd5c6a7f7795e4aca35ae334884e08a9a2e2690
3
+ metadata.gz: 64f54ec070076d76e56d136ae5591375af7fef5de343ace173a968d960944b72
4
+ data.tar.gz: 0ad4b7661dabd9358bc09cbfbe2f61b83fec4f59eac5d98257363e42796a3b38
5
5
  SHA512:
6
- metadata.gz: 60930a3608223f8ddf7f93f51206c8f2a8ab7779b59a022dc32489edf02f838e91b7ec1f620b005bd784c2ae609c9d53d8028f1c2332f03f3ff587601920cbe0
7
- data.tar.gz: 238254a8922918c08ea3074fb70af71b0c9e8f01ac9567b689a2d6d696655e220feff73e6c605e53102aa5422c4827040742d6a366b5338cdbc6e399262add81
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(text_area(model, field, value, options))
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 text_area(model, field, value, options = {})
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
@@ -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.auto_scaling_group_name] }
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.updated_at < allowed_time_for_item(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=(password)
36
- set encrypted_password: cipher.encrypt_and_sign(password)
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)
@@ -8,6 +8,7 @@ class UserModelAuditLog < UserAuditLog
8
8
  # Fields
9
9
  #
10
10
  field :changed_values, type: String
11
+ field :deleted_oid, type: BSON::ObjectId
11
12
  #
12
13
  # Relationships
13
14
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '1.0.7'
4
+ VERSION = '1.0.13'
5
5
  end
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.7
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-08-27 00:00:00.000000000 Z
11
+ date: 2020-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport