cia 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 721b3ddd4c0d65f03c32681de80e18d7dc2709c9
4
- data.tar.gz: 634c7289d85d4f7a8768e97abaec2a3acade6175
3
+ metadata.gz: 234bc3aa9cfec16e08ee99ab9cd84ab4d2091c57
4
+ data.tar.gz: c50e8d44618065c7db976ae8d576e9aaba3b248f
5
5
  SHA512:
6
- metadata.gz: 3757ab4bf222f509a11d10a084985eb7beffc34681a5076f26ad9471220bdf1f4283ccb6b999f2ba9a834ae09441b81f91bd1d7a59aacfd56be3ef9a72b4ca5e
7
- data.tar.gz: 95b73f3e943191df350c9765716332638aa0cdd2975ec31465014f2bd1ba3a6007bcd7b2625b2620a9fb721d8be5650d6a3ecc5a3812b1e463b4c8df08f26f95
6
+ metadata.gz: a31749f5da2bc7f9b3cdd446f3306b2781b4cfa6424c5bc0c1366b8c83f326184c64a3182ba4a2eab6f6249101e1812e74c16c6a872997d361863985c1b11b24
7
+ data.tar.gz: 947727ff296e99de71db0d534abe8381d68d532c22391b2b848b255fd11fe15fc862493de2541d09a4d48693e449082101b6e120a999df8695fd695694771057
data/Readme.md CHANGED
@@ -5,7 +5,7 @@ Audit model actions like update/create/destroy/<custom> + attribute changes.
5
5
 
6
6
  - normalized and queryable through table layout
7
7
  - actors and subjects are polymorphic
8
- - works on ActiveRecord 3.2, 4.0 and 4.1
8
+ - works on ActiveRecord 3.2+
9
9
 
10
10
  Table layout:
11
11
 
@@ -63,7 +63,7 @@ CIA.current_actor = @user
63
63
  # custom changes
64
64
  class User < ActiveRecord::Base
65
65
  def cia_changes
66
- changes.merge("this" => ["always", "changes"])
66
+ super.merge("this" => ["always", "changes"])
67
67
  end
68
68
  end
69
69
 
@@ -6,7 +6,15 @@ module CIA
6
6
  end
7
7
 
8
8
  def cia_changes
9
- changes
9
+ if respond_to?(:has_changes_to_save?)
10
+ if has_changes_to_save?
11
+ changes_to_save
12
+ else
13
+ saved_changes
14
+ end
15
+ else
16
+ changes
17
+ end
10
18
  end
11
19
 
12
20
  def cia_previous_changes(changes=nil)
@@ -1,3 +1,3 @@
1
1
  module CIA
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-29 00:00:00.000000000 Z
11
+ date: 2017-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -133,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - ">="
135
135
  - !ruby/object:Gem::Version
136
- version: 2.0.0
136
+ version: 2.2.0
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
139
  - - ">="
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project:
144
- rubygems_version: 2.4.5.1
144
+ rubygems_version: 2.5.2
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: Audit model events like update/create/delete + attribute changes + group