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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20e9e57d5a67995068422a609568b3124e6bab4b
4
- data.tar.gz: be6fdf6286b4b661881e13e529b8f7ce220cdccf
3
+ metadata.gz: bbc0e538d852182737e0d46e6124c56ee7f598bd
4
+ data.tar.gz: 1019133ccfeaaf250a64bed156bc959206efed1a
5
5
  SHA512:
6
- metadata.gz: eb7025f50e12b1fca55f87a66ae177b923a0d06800d9b3fa1fc0979e08b97a48976e31c341a2f522d521c49d487ccdf652be893a7c98c0644eefe5af421f9269
7
- data.tar.gz: 744819fb3d4dd1d27c02064c5cd09ce504c650a3cb91d96c1aed298d5810b3bcabc79ce24abac6e3b7d517672cd3da89d9e850c8d63f9dad5649b03114e78ccf
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 == 'roles_mask' && defined?(EffectiveRoles) && respond_to?(:roles)
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 == 'roles_mask' && defined?(EffectiveRoles) && respond_to?(:roles)
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveLogging
2
- VERSION = '3.0.0'.freeze
2
+ VERSION = '3.0.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.0.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-02-07 00:00:00.000000000 Z
11
+ date: 2019-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails