logga 4.0.2 → 6.0.0
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/README.md +4 -4
- data/Rakefile +1 -0
- data/VERSION +1 -2
- data/lib/logga/active_record.rb +2 -2
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a816cf8594e1bc18bba798c03ce28d73c05210cf396951f7f6850493deaf5029
|
4
|
+
data.tar.gz: 20e9e662498165522363f68a03cc51908ba58d62762e766eecb17468acb2084f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a639733d7e1674246a118d76f28a33193a664fa3b6c7d13c2a9970b286e2da97862c7c42a752ffce76c186d862759b4a6428f3c2587d66fa42e4e63b74ff0b
|
7
|
+
data.tar.gz: 0b581d6df25fa0857fa82da1a2c335f24895b0e1d67bf1b946d700caa22d70fd87f8d709f14b3d9c3e2d00efc8e5e165a6e05c317c3564a963c2858561f11047
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ Provides attribute logging functionality to ActiveRecord objects.
|
|
7
7
|
|
8
8
|
## Requirements
|
9
9
|
|
10
|
-
|
10
|
+
- Ruby >= 3.0
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -36,10 +36,10 @@ Add the following to your model:
|
|
36
36
|
```ruby
|
37
37
|
class Thing < ApplicationRecord
|
38
38
|
# Optional author accessor. See #author
|
39
|
-
attr_accessor :author
|
39
|
+
attr_accessor :author
|
40
40
|
|
41
41
|
# Association to :log_entries, which the loggable object must response to for logging.
|
42
|
-
has_many :log_entries, as: :loggable, dependent: :destroy
|
42
|
+
has_many :log_entries, as: :loggable, dependent: :destroy
|
43
43
|
|
44
44
|
add_log_entries_for(
|
45
45
|
:create, # Log on object create
|
@@ -115,7 +115,7 @@ end
|
|
115
115
|
|
116
116
|
## Development
|
117
117
|
|
118
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
118
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec appraisal rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
119
119
|
|
120
120
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
121
121
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
6.0.0
|
data/lib/logga/active_record.rb
CHANGED
@@ -80,13 +80,13 @@ module Logga
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def create_log_entry(entry)
|
83
|
-
log_receiver
|
83
|
+
log_receiver.log_entries&.create(entry)
|
84
84
|
end
|
85
85
|
|
86
86
|
def creation_at
|
87
87
|
return Time.current unless log_receiver == self
|
88
88
|
|
89
|
-
(log_receiver
|
89
|
+
(log_receiver.log_entries.order(:created_at).first&.created_at || Time.current) - 0.1.seconds
|
90
90
|
end
|
91
91
|
|
92
92
|
def default_creation_log_body(record)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boxt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,40 +16,40 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '7'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '9'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '7'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '9'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: activesupport
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '7'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '9'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
49
|
+
version: '7'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '9'
|
53
53
|
description: Extensions to ActiveRecord to log entries on model changes
|
54
54
|
email:
|
55
55
|
- developers@boxt.co.uk
|
@@ -78,14 +78,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements:
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
81
|
+
version: '3.1'
|
82
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
84
|
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
88
|
+
rubygems_version: 3.5.22
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: ActiveRecord log entries on model changes
|