effective_logging 3.5.0 → 3.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b21edfec95b3f6878025e153f44ebb09bc798ac01d3a117aecfc85b341586078
4
- data.tar.gz: 8c14b70a56c35b492b19d00fae30b786d871cd3ac95c7c61a34ca133b4533f9d
3
+ metadata.gz: d5019a8c1d47713eb61c59d6241d6c64517fdf512e80ec508048a9a87a27404a
4
+ data.tar.gz: 1145e529b40bf909ea60df6af22ded27459ce376c0b674cb3311d2d775901161
5
5
  SHA512:
6
- metadata.gz: 82a1e987a4642e855ab022c2b81a258fdcf95ad55edea9698e7f2f3766773c0b9f78f8b932c965e64df1c4c8cb6821600dee97063dcfd65c2785f75059e01c52
7
- data.tar.gz: 33699371abdac488fc0953ba85ab7117076a2b94cb07ce7c7744d86ab90b7d389d1df6a27b33e2920005e3f3406853a3d38a53cd5eb377de090550a0f5e9bfb2
6
+ metadata.gz: bb500c434341914ce32bf2e39e0e977db957aaee656a0a7f4d8df7eb4d7f1fca30593ce6b85de1dbde23864846f3941f191e65b7b828fee2a2cd5cceb1882dc9
7
+ data.tar.gz: 3b84818babf85513db6260069e74f1cd7575888efc667070413083f80bbe7e7a2371a58d651f67f75785c85592c702f3db01e206edf7af7abfc252f6aadd881a
@@ -8,26 +8,30 @@ class EffectiveLogsDatatable < Effective::Datatable
8
8
  if attributes[:user] == false
9
9
  # Do not include
10
10
  else
11
- col :user, search: :string, sort: false
11
+ col(:user, search: :string).search do |collection, term, column, sql_column|
12
+ klass = current_user.class
13
+ users = Effective::Resource.new(klass).search_any(term, columns: [:first_name, :middle_name, :last_name, :name, :email])
14
+ collection.where(user_type: klass.name, user_id: users)
15
+ end.sort do |collection, direction, column, sql_column|
16
+ collection.order(user_id: direction)
17
+ end
12
18
  end
13
19
 
14
20
  unless attributes[:status] == false
15
- col :status, search: { collection: EffectiveLogging.statuses }
21
+ col :status, search: { collection: EffectiveLogging.statuses, fuzzy: false }
16
22
  end
17
23
 
18
- col :changes_to_type, visible: false
19
- col :changes_to_id, visible: false
24
+ col :changes_to_type, visible: false, sort: false
25
+ col :changes_to_id, visible: false, sort: false
20
26
 
21
- col :associated_type, visible: false
22
- col :associated_id, visible: false, label: 'Associated Id'
27
+ col :associated_type, visible: false, sort: false
28
+ col :associated_id, visible: false, label: 'Associated Id', sort: false
23
29
  col :associated_to_s, label: 'Associated'
24
30
 
25
- col :message do |log|
31
+ col :message, sort: false do |log|
26
32
  (log.message || '').gsub("\n", '<br>')
27
33
  end
28
34
 
29
- col :logs_count, visible: false
30
-
31
35
  col :details, visible: false, sort: false do |log|
32
36
  tableize_hash(log.details.except(:email))
33
37
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveLogging
2
- VERSION = '3.5.0'.freeze
2
+ VERSION = '3.5.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-26 00:00:00.000000000 Z
11
+ date: 2022-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails