web47core 1.0.8 → 1.0.14

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: 7b7fe306fd542b3f2f2c35c4d8fabbcc625cae18db9c9424b0eef5134a7167da
4
- data.tar.gz: 4ab1d0fd7b51336c08af3b7a38349830872f41e979f786621288e0b16c4b0e58
3
+ metadata.gz: ef5eb2bf315d0be4a596a440d855e049ce11ebd0834d9598c81ae674551fd9d5
4
+ data.tar.gz: 833d99f9b33348a8d4b9a61584d61cd6dae5d9a1b44a0d4b3046b48b68369f7d
5
5
  SHA512:
6
- metadata.gz: 28e7320bb0bc526582605f3160047a06eeb86280bdb384556b1ddc067c0e04cd539ea8691da6472df804193b3a642002b53fb74bcdfcc4dec878670f9cbf3549
7
- data.tar.gz: 2bf17be859310206cdb2b59ae587d304a07f239be637d1de058874b0826df3e6d8cbc1a1644eefb29752fc81af319819503689bb773f4317cd19a7505254e6b4
6
+ metadata.gz: 9b84594fa18bf1f612fb4312002c1b9913b8d3ae70d3848f1c612b858fc3a808a33759d82ffd79f8e9011e5e063d11833917d96a05d7a795dfef4529f08d8ca8
7
+ data.tar.gz: cebbbc92c09cd7459fcc1ea2c6f087fff240e8c1eb74b339206b36e6f1297d59e957a0906be3fd087a4a1e473ca9d650dc8edec5c806489e692732e403fa8114
@@ -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
@@ -97,7 +97,8 @@ module CoreLinkHelper
97
97
  return unless can? :edit, obj
98
98
 
99
99
  icon = options[:icon] || 'edit'
100
- content_tag(:a, href: path) do
100
+ tooltip = options[:tooltip] || 'Edit'
101
+ content_tag(:a, href: path, class: 'tooltipped', data: {tooltip: tooltip}) do
101
102
  concat(content_tag(:i, class: 'material-icons') do
102
103
  icon
103
104
  end)
@@ -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
  #
@@ -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)
@@ -233,6 +233,15 @@ class Notification
233
233
  result
234
234
  end
235
235
 
236
+ #
237
+ # Titleize the type of this notification as its name
238
+ #
239
+ def name
240
+ _type.titleize
241
+ rescue StandardError
242
+ _type
243
+ end
244
+
236
245
  private
237
246
 
238
247
  #
@@ -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.8'
4
+ VERSION = '1.0.14'
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.8
4
+ version: 1.0.14
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-28 00:00:00.000000000 Z
11
+ date: 2020-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport