acts_as_trackable 0.1.1 → 0.2.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: 041cc056fefd655f6a77b9489f9e06d41fdd543fb81e8b6ebca22790a63a77bb
4
- data.tar.gz: df5ac7eb491c260a79e6b840c7ce35cff36cb42a5b75787fd12cec224f1fa195
3
+ metadata.gz: 8e1e2127839ff4762bd8b4eb413c7afd843163dfb580413772973d19f77b95b1
4
+ data.tar.gz: a1b5c5e26d23eb367d2677b04b138697b29e1f481173e0abb26d9a17cc7f2033
5
5
  SHA512:
6
- metadata.gz: 99b5d849667c3f48ab76948929715aa893b1c96ecb6b2df7a8fa819e520b2be1d587e5d9e2923e703811b85300153cb099a70a3ab81c24a31a13d3809fc5ce3e
7
- data.tar.gz: 063aaf79b5d6f557619d284059325b74b6f5f4052df4274a08e8eb666c2b5ccbd3476ce76ade9df6e78ed05c99a7359f43e02a4bf7d829d7f7814f259d83a374
6
+ metadata.gz: 6505c6da91c522a44d2608010086c8f0670e28ad938277fe6bfc5ab71b59dccce3a1d960509d94b9ac370698d1b03d0f3373b78edf8a2bad99c6dc28f22bdd01
7
+ data.tar.gz: 0d1b06c1676b8714037bc574571dd92c4f8900b3321f04efb8d3a20fd25c0dd8f299d4943d98ccb964a5b545957f6f3cd62e090cecc8a854ff3544740e082997
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 3.1.2
data/Gemfile CHANGED
@@ -1,10 +1,11 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
- gem 'activerecord', '~> 6.1', '>= 6.1.7.10'
5
- gem 'activesupport', '~> 6.1', '>= 6.1.7.10'
6
- gem 'rake', '~> 13.2.1'
4
+ gem 'activerecord', '~> 7.2', '>= 7.2.2'
5
+ gem 'activesupport', '~> 7.2', '>= 7.2.2'
6
+ gem 'nokogiri', '~> 1.16', '>= 1.16.7'
7
+ gem 'rake', '~> 13.2', '>= 13.2.1'
7
8
 
8
9
  group :test do
9
- gem 'sqlite3', '~> 1.6.8'
10
+ gem 'sqlite3', '~> 2.2'
10
11
  end
data/Gemfile.lock CHANGED
@@ -1,88 +1,128 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acts_as_trackable (0.1.1)
4
+ acts_as_trackable (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- actionpack (6.1.7.10)
10
- actionview (= 6.1.7.10)
11
- activesupport (= 6.1.7.10)
12
- rack (~> 2.0, >= 2.0.9)
9
+ actionpack (7.2.2)
10
+ actionview (= 7.2.2)
11
+ activesupport (= 7.2.2)
12
+ nokogiri (>= 1.8.5)
13
+ racc
14
+ rack (>= 2.2.4, < 3.2)
15
+ rack-session (>= 1.0.1)
13
16
  rack-test (>= 0.6.3)
14
- rails-dom-testing (~> 2.0)
15
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
16
- actionview (6.1.7.10)
17
- activesupport (= 6.1.7.10)
17
+ rails-dom-testing (~> 2.2)
18
+ rails-html-sanitizer (~> 1.6)
19
+ useragent (~> 0.16)
20
+ actionview (7.2.2)
21
+ activesupport (= 7.2.2)
18
22
  builder (~> 3.1)
19
- erubi (~> 1.4)
20
- rails-dom-testing (~> 2.0)
21
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
22
- activemodel (6.1.7.10)
23
- activesupport (= 6.1.7.10)
24
- activerecord (6.1.7.10)
25
- activemodel (= 6.1.7.10)
26
- activesupport (= 6.1.7.10)
27
- activesupport (6.1.7.10)
28
- concurrent-ruby (~> 1.0, >= 1.0.2)
23
+ erubi (~> 1.11)
24
+ rails-dom-testing (~> 2.2)
25
+ rails-html-sanitizer (~> 1.6)
26
+ activemodel (7.2.2)
27
+ activesupport (= 7.2.2)
28
+ activerecord (7.2.2)
29
+ activemodel (= 7.2.2)
30
+ activesupport (= 7.2.2)
31
+ timeout (>= 0.4.0)
32
+ activesupport (7.2.2)
33
+ base64
34
+ benchmark (>= 0.3)
35
+ bigdecimal
36
+ concurrent-ruby (~> 1.0, >= 1.3.1)
37
+ connection_pool (>= 2.2.5)
38
+ drb
29
39
  i18n (>= 1.6, < 2)
40
+ logger (>= 1.4.2)
30
41
  minitest (>= 5.1)
31
- tzinfo (~> 2.0)
32
- zeitwerk (~> 2.3)
42
+ securerandom (>= 0.3)
43
+ tzinfo (~> 2.0, >= 2.0.5)
44
+ base64 (0.2.0)
45
+ benchmark (0.4.0)
46
+ bigdecimal (3.1.8)
33
47
  builder (3.3.0)
34
48
  concurrent-ruby (1.3.4)
49
+ connection_pool (2.4.1)
35
50
  crass (1.0.6)
51
+ date (3.4.1)
52
+ drb (2.2.1)
36
53
  erubi (1.13.0)
37
54
  generator_spec (0.10.0)
38
55
  activesupport (>= 3.0.0)
39
56
  railties (>= 3.0.0)
40
57
  i18n (1.14.6)
41
58
  concurrent-ruby (~> 1.0)
59
+ io-console (0.8.0)
60
+ irb (1.14.1)
61
+ rdoc (>= 4.0.0)
62
+ reline (>= 0.4.2)
63
+ logger (1.6.2)
42
64
  loofah (2.23.1)
43
65
  crass (~> 1.0.2)
44
66
  nokogiri (>= 1.12.0)
45
- method_source (1.1.0)
46
- mini_portile2 (2.8.8)
47
- minitest (5.25.1)
48
- nokogiri (1.15.6)
49
- mini_portile2 (~> 2.8.2)
67
+ minitest (5.25.4)
68
+ nokogiri (1.16.8-arm64-darwin)
50
69
  racc (~> 1.4)
70
+ nokogiri (1.16.8-x86_64-darwin)
71
+ racc (~> 1.4)
72
+ psych (5.2.1)
73
+ date
74
+ stringio
51
75
  racc (1.8.1)
52
- rack (2.2.10)
76
+ rack (3.1.8)
77
+ rack-session (2.0.0)
78
+ rack (>= 3.0.0)
53
79
  rack-test (2.1.0)
54
80
  rack (>= 1.3)
81
+ rackup (2.2.1)
82
+ rack (>= 3)
55
83
  rails-dom-testing (2.2.0)
56
84
  activesupport (>= 5.0.0)
57
85
  minitest
58
86
  nokogiri (>= 1.6)
59
- rails-html-sanitizer (1.6.0)
87
+ rails-html-sanitizer (1.6.1)
60
88
  loofah (~> 2.21)
61
- nokogiri (~> 1.14)
62
- railties (6.1.7.10)
63
- actionpack (= 6.1.7.10)
64
- activesupport (= 6.1.7.10)
65
- method_source
89
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
90
+ railties (7.2.2)
91
+ actionpack (= 7.2.2)
92
+ activesupport (= 7.2.2)
93
+ irb (~> 1.13)
94
+ rackup (>= 1.0.0)
66
95
  rake (>= 12.2)
67
- thor (~> 1.0)
96
+ thor (~> 1.0, >= 1.2.2)
97
+ zeitwerk (~> 2.6)
68
98
  rake (13.2.1)
69
- sqlite3 (1.6.9)
70
- mini_portile2 (~> 2.8.0)
99
+ rdoc (6.8.1)
100
+ psych (>= 4.0.0)
101
+ reline (0.5.12)
102
+ io-console (~> 0.5)
103
+ securerandom (0.4.0)
104
+ sqlite3 (2.4.0-arm64-darwin)
105
+ sqlite3 (2.4.0-x86_64-darwin)
106
+ stringio (3.1.2)
71
107
  thor (1.3.2)
108
+ timeout (0.4.2)
72
109
  tzinfo (2.0.6)
73
110
  concurrent-ruby (~> 1.0)
111
+ useragent (0.16.11)
74
112
  zeitwerk (2.6.18)
75
113
 
76
114
  PLATFORMS
77
- ruby
115
+ arm64-darwin
116
+ x86_64-darwin
78
117
 
79
118
  DEPENDENCIES
80
- activerecord (~> 6.1, >= 6.1.7.10)
81
- activesupport (~> 6.1, >= 6.1.7.10)
119
+ activerecord (~> 7.2, >= 7.2.2)
120
+ activesupport (~> 7.2, >= 7.2.2)
82
121
  acts_as_trackable!
83
122
  generator_spec
84
- rake (~> 13.2.1)
85
- sqlite3 (~> 1.6.8)
123
+ nokogiri (~> 1.16, >= 1.16.7)
124
+ rake (~> 13.2, >= 13.2.1)
125
+ sqlite3 (~> 2.2)
86
126
 
87
127
  BUNDLED WITH
88
- 2.1.4
128
+ 2.5.19
data/README.md CHANGED
@@ -6,10 +6,10 @@ ActsAsTrackable is a gem that simplifies the process of tracking your DB object'
6
6
 
7
7
  ## Installation
8
8
 
9
- Add this line to your application's Gemfile(For now you have to add it locally v0.1.0):
9
+ Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'acts_as_trackable', path: 'path_to_gem'
12
+ gem 'acts_as_trackable'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -35,7 +35,7 @@ After that run the following commands:
35
35
  acts_as_trackable
36
36
  ```
37
37
 
38
- - If your model is expected to have multiple version of each object, pass the column that tracks the version to acts_as_trackable as a symbol, acts_as_trackable is smart enough to relink the object_activity with the latest version(Previous versions won't be linked to any activity):
38
+ - If your model is expected to have multiple versions of each object, pass the column that tracks the version to acts_as_trackable as a symbol, acts_as_trackable is smart enough to relink the object_activity with the latest version(Previous versions won't be linked to any activity):
39
39
 
40
40
  ```ruby
41
41
  acts_as_trackable :latest_x_version_id
@@ -51,10 +51,23 @@ After that run the following commands:
51
51
  ```
52
52
 
53
53
 
54
- - Joining your records with objects_activities:
54
+ - Joining your records with objects_activities for Sorting, Searching, and Filtering:
55
55
  ```ruby
56
56
  @records.left_joins_object_activities(['YourUserModelClassName'])
57
57
  ```
58
+
59
+
60
+ - Fetching an object's owners/modifiers:
61
+ ```ruby
62
+ @record.created_by
63
+ @record.updated_by
64
+ ```
65
+
66
+ - Fetching object_activities created/updated by user:
67
+ ```ruby
68
+ @user.object_activities_as_creator
69
+ @user.object_activities_as_updater
70
+ ```
58
71
  ## Development
59
72
 
60
73
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.email = ['a.keewan@zenhr.com']
8
8
  spec.homepage = 'https://www.zenhr.com'
9
9
  spec.license = 'MIT'
10
- spec.required_ruby_version = Gem::Requirement.new('>= 2.7.2')
10
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.1.2')
11
11
  spec.metadata["homepage_uri"] = spec.homepage
12
12
  spec.metadata["source_code_uri"] = 'https://github.com/a-keewan/acts_as_trackable'
13
13
  spec.metadata["changelog_uri"] = 'https://github.com/a-keewan/acts_as_trackable/blob/master/changelog.md'
data/changelog.md CHANGED
@@ -1,3 +1,13 @@
1
1
  # acts_as_trackable Changelog
2
-
2
+ ## Version: 0.2.1
3
+ ### Patch
4
+ - Upgraded dependencies to patch https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-rxv5-gxqc-xx8g
5
+ ## Version: 0.2.0
6
+ ### Patch
7
+ - Upgraded all used dependencies to patch https://github.com/advisories/GHSA-vv62-jfwq-693v mainly caused by using nokogiri
8
+ - Increased required_ruby_version to >= 3.1.2
9
+ ## Version: 0.1.1
10
+ ### Fix:
11
+ - Replaced user_type.downcase with user_type.underscore to support joining with user classes consisting of more than word.
12
+ - Added how-to access objects steps to the README file.
3
13
  ## Version: 0.1.0
@@ -1,3 +1,3 @@
1
1
  module ActsAsTrackable
2
- VERSION = "0.1.1"
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_trackable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmad Keewan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-11-17 00:00:00.000000000 Z
12
+ date: 2024-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: generator_spec
@@ -74,14 +74,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - ">="
76
76
  - !ruby/object:Gem::Version
77
- version: 2.7.2
77
+ version: 3.1.2
78
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubygems_version: 3.1.4
84
+ rubygems_version: 3.3.7
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: ActsAsTrackable is a RoR gem that simplifies tracking the creation and modification