effective_logging 3.0.0 → 3.0.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 +4 -4
- data/README.md +20 -0
- data/app/models/concerns/acts_as_loggable.rb +2 -2
- data/lib/effective_logging/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc0e538d852182737e0d46e6124c56ee7f598bd
|
4
|
+
data.tar.gz: 1019133ccfeaaf250a64bed156bc959206efed1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9edf59801301335283763230a35134950349742a6b4fe81b728fe48fc42608107a81b6ceabe6e7af02cc473f540c135a6e71acc9e70eee9e43a931fb540bb681
|
7
|
+
data.tar.gz: 11897b22f2dacfcdb0d000c5d78dc0a5b89857db75cdf6f70cc387d36bafd4b4341d5ee00d2d966fc86298b9a93a93c96b83ca635b4b4f0b1c0011c32a93a279
|
data/README.md
CHANGED
@@ -339,6 +339,26 @@ EffectiveLogsDatatable.new(for: @user.id)
|
|
339
339
|
EffectiveLogsDatatable.new(for: [1, 2, 3]) # Users with ID 1, 2 and 3
|
340
340
|
```
|
341
341
|
|
342
|
+
### Upgrade from 2.0
|
343
|
+
|
344
|
+
The database has changed slightly in 3.x
|
345
|
+
|
346
|
+
```ruby
|
347
|
+
rails generate migration upgrade_effective_logging
|
348
|
+
```
|
349
|
+
|
350
|
+
and then:
|
351
|
+
|
352
|
+
```ruby
|
353
|
+
change_column :logs, :message, :text # Was string
|
354
|
+
|
355
|
+
add_column :logs, :changes_to_type, :string
|
356
|
+
add_column :logs, :changes_to_id, :integer
|
357
|
+
|
358
|
+
ActiveRecord::Base.connection.execute('UPDATE logs SET changes_to_type = associated_type;')
|
359
|
+
ActiveRecord::Base.connection.execute('UPDATE logs SET changes_to_id = associated_id;')
|
360
|
+
```
|
361
|
+
|
342
362
|
## License
|
343
363
|
|
344
364
|
MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
|
@@ -54,12 +54,12 @@ module ActsAsLoggable
|
|
54
54
|
|
55
55
|
# Format the title of this attribute. Return nil to use the default attribute.titleize
|
56
56
|
def log_changes_formatted_attribute(attribute)
|
57
|
-
'Roles' if attribute ==
|
57
|
+
'Roles' if attribute == :roles_mask && defined?(EffectiveRoles) && respond_to?(:roles)
|
58
58
|
end
|
59
59
|
|
60
60
|
# Format the value of this attribute. Return nil to use the default to_s
|
61
61
|
def log_changes_formatted_value(attribute, value)
|
62
|
-
EffectiveRoles.roles_for(value) if attribute ==
|
62
|
+
EffectiveRoles.roles_for(value) if attribute == :roles_mask && defined?(EffectiveRoles) && respond_to?(:roles)
|
63
63
|
end
|
64
64
|
|
65
65
|
def log_changes_datatable
|
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.0.
|
4
|
+
version: 3.0.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: 2019-
|
11
|
+
date: 2019-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|