paper_trail 2.7.1 → 2.7.2
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 +7 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +1 -1
- data/README.md +30 -0
- data/lib/paper_trail/config.rb +1 -1
- data/lib/paper_trail/controller.rb +1 -1
- data/lib/paper_trail/has_paper_trail.rb +5 -3
- data/lib/paper_trail/version.rb +24 -5
- data/lib/paper_trail/version_number.rb +1 -1
- data/paper_trail.gemspec +8 -2
- data/test/custom_json_serializer.rb +13 -0
- data/test/unit/model_test.rb +80 -1
- data/test/unit/serializer_test.rb +45 -2
- data/test/unit/serializers/mixin_json_test.rb +1 -13
- data/test/unit/version_test.rb +14 -0
- metadata +24 -22
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d52253999aa50ea646f9941296fa663fda663409
|
4
|
+
data.tar.gz: a5e3bb3431519e3b68e4c0c7807b586cbb2e0da5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 91563f3ad9191ee2f310d4ddc89373207379b0eedde16d0e7cfa719d0a6fa34d9176d1d1f21e5d384030fff06f95f8bdb70c27e0d220867e908c3c36a28b1d33
|
7
|
+
data.tar.gz: a581a7fd4a286cdaec57f1eb7d608db139da015aadb59b461bd201ab8c08e370e086062d7f92c3e51459b2f411c28203e3b481a6982a4f846e79b1b44d0361a3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 2.7.2
|
2
|
+
|
3
|
+
- [#228](https://github.com/airblade/paper_trail/issues/228) - Refactored default `user_for_paper_trail` method implementation
|
4
|
+
so that `current_user` only gets invoked if it is defined.
|
5
|
+
- [#219](https://github.com/airblade/paper_trail/pull/219) - Fixed issue where attributes stored with `nil` value might not get
|
6
|
+
reified properly depending on the way the serializer worked.
|
7
|
+
- [#213](https://github.com/airblade/paper_trail/issues/213) - Added a `version_limit` option to the `PaperTrail::Config` options
|
8
|
+
that can be used to restrict the number of versions PaperTrail will store per object instance.
|
9
|
+
- [#187](https://github.com/airblade/paper_trail/pull/187) - Confirmed JRuby support.
|
10
|
+
- [#174](https://github.com/airblade/paper_trail/pull/174) - The `event` field on the versions table can now be customized.
|
11
|
+
|
1
12
|
## 2.7.1
|
2
13
|
|
3
14
|
- [#206](https://github.com/airblade/paper_trail/issues/206) - Fixed Ruby 1.8.7 compatibility for tracking `object_changes`.
|
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
data/README.md
CHANGED
@@ -193,6 +193,23 @@ class Article < ActiveRecord::Base
|
|
193
193
|
end
|
194
194
|
```
|
195
195
|
|
196
|
+
You may also have the `Version` model save a custom string in it's `event` field instead of the typical `create`, `update`, `destroy`.
|
197
|
+
PaperTrail supplies a custom accessor method called `paper_trail_event`, which it will attempt to use to fill the `event` field before
|
198
|
+
falling back on one of the default events.
|
199
|
+
|
200
|
+
```ruby
|
201
|
+
>> a = Article.create
|
202
|
+
>> a.versions.size # 1
|
203
|
+
>> a.versions.last.event # 'create'
|
204
|
+
>> a.paper_trail_event = 'update title'
|
205
|
+
>> a.update_attributes :title => 'My Title'
|
206
|
+
>> a.versions.size # 2
|
207
|
+
>> a.versions.last.event # 'update title'
|
208
|
+
>> a.paper_trail_event = nil
|
209
|
+
>> a.update_attributes :title => "Alternate"
|
210
|
+
>> a.versions.size # 3
|
211
|
+
>> a.versions.last.event # 'update'
|
212
|
+
```
|
196
213
|
|
197
214
|
## Choosing When To Save New Versions
|
198
215
|
|
@@ -754,6 +771,19 @@ A valid serializer is a `module` (or `class`) that defines a `load` and `dump` m
|
|
754
771
|
* [Yaml](https://github.com/airblade/paper_trail/blob/master/lib/paper_trail/serializers/yaml.rb) - Default
|
755
772
|
* [Json](https://github.com/airblade/paper_trail/blob/master/lib/paper_trail/serializers/json.rb)
|
756
773
|
|
774
|
+
## Limiting the number of versions created per object instance
|
775
|
+
|
776
|
+
If you are weary of your `versions` table growing to an unwieldy size, or just don't care to track more than a certain number of versions per object,
|
777
|
+
there is a configuration option that can be set to cap the number of versions saved per object. Note that this value must be numeric, and it only applies to
|
778
|
+
versions other than `create` events (which will always be preserved if they are stored).
|
779
|
+
|
780
|
+
```ruby
|
781
|
+
# will make it so that a maximum of 4 versions will be stored for each object (the 3 most recent ones plus a `create` event)
|
782
|
+
>> PaperTrail.config.version_limit = 3
|
783
|
+
# disables/removes the version limit
|
784
|
+
>> PaperTrail.config.version_limit = nil
|
785
|
+
```
|
786
|
+
|
757
787
|
## Deleting Old Versions
|
758
788
|
|
759
789
|
Over time your `versions` table will grow to an unwieldy size. Because each version is self-contained (see the Diffing section above for more) you can simply delete any records you don't want any more. For example:
|
data/lib/paper_trail/config.rb
CHANGED
@@ -3,7 +3,7 @@ require 'singleton'
|
|
3
3
|
module PaperTrail
|
4
4
|
class Config
|
5
5
|
include Singleton
|
6
|
-
attr_accessor :enabled, :timestamp_field, :serializer
|
6
|
+
attr_accessor :enabled, :timestamp_field, :serializer, :version_limit
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
@enabled = true # Indicates whether PaperTrail is on or off.
|
@@ -14,7 +14,7 @@ module PaperTrail
|
|
14
14
|
# Override this method in your controller to call a different
|
15
15
|
# method, e.g. `current_person`, or anything you like.
|
16
16
|
def user_for_paper_trail
|
17
|
-
current_user
|
17
|
+
current_user if defined?(current_user)
|
18
18
|
end
|
19
19
|
|
20
20
|
# Returns any information about the controller or request that you
|
@@ -57,6 +57,8 @@ module PaperTrail
|
|
57
57
|
class_attribute :versions_association_name
|
58
58
|
self.versions_association_name = options[:versions] || :versions
|
59
59
|
|
60
|
+
attr_accessor :paper_trail_event
|
61
|
+
|
60
62
|
has_many self.versions_association_name,
|
61
63
|
:class_name => version_class_name,
|
62
64
|
:as => :item,
|
@@ -190,7 +192,7 @@ module PaperTrail
|
|
190
192
|
def record_create
|
191
193
|
if switched_on?
|
192
194
|
data = {
|
193
|
-
:event => 'create',
|
195
|
+
:event => paper_trail_event || 'create',
|
194
196
|
:whodunnit => PaperTrail.whodunnit
|
195
197
|
}
|
196
198
|
|
@@ -205,7 +207,7 @@ module PaperTrail
|
|
205
207
|
def record_update
|
206
208
|
if switched_on? && changed_notably?
|
207
209
|
data = {
|
208
|
-
:event => 'update',
|
210
|
+
:event => paper_trail_event || 'update',
|
209
211
|
:object => object_to_string(item_before_change),
|
210
212
|
:whodunnit => PaperTrail.whodunnit
|
211
213
|
}
|
@@ -228,7 +230,7 @@ module PaperTrail
|
|
228
230
|
if switched_on? and not new_record?
|
229
231
|
version_class.create merge_metadata(:item_id => self.id,
|
230
232
|
:item_type => self.class.base_class.name,
|
231
|
-
:event => 'destroy',
|
233
|
+
:event => paper_trail_event || 'destroy',
|
232
234
|
:object => object_to_string(item_before_change),
|
233
235
|
:whodunnit => PaperTrail.whodunnit)
|
234
236
|
end
|
data/lib/paper_trail/version.rb
CHANGED
@@ -3,8 +3,10 @@ class Version < ActiveRecord::Base
|
|
3
3
|
validates_presence_of :event
|
4
4
|
attr_accessible :item_type, :item_id, :event, :whodunnit, :object, :object_changes
|
5
5
|
|
6
|
+
after_create :enforce_version_limit!
|
7
|
+
|
6
8
|
def self.with_item_keys(item_type, item_id)
|
7
|
-
|
9
|
+
where :item_type => item_type, :item_id => item_id
|
8
10
|
end
|
9
11
|
|
10
12
|
def self.creates
|
@@ -19,22 +21,26 @@ class Version < ActiveRecord::Base
|
|
19
21
|
where :event => 'destroy'
|
20
22
|
end
|
21
23
|
|
24
|
+
def self.not_creates
|
25
|
+
where 'event <> ?', 'create'
|
26
|
+
end
|
27
|
+
|
22
28
|
scope :subsequent, lambda { |version|
|
23
|
-
where(
|
29
|
+
where("#{self.primary_key} > ?", version).order("#{self.primary_key} ASC")
|
24
30
|
}
|
25
31
|
|
26
32
|
scope :preceding, lambda { |version|
|
27
|
-
where(
|
33
|
+
where("#{self.primary_key} < ?", version).order("#{self.primary_key} DESC")
|
28
34
|
}
|
29
35
|
|
30
36
|
scope :following, lambda { |timestamp|
|
31
37
|
# TODO: is this :order necessary, considering its presence on the has_many :versions association?
|
32
|
-
where(
|
38
|
+
where("#{PaperTrail.timestamp_field} > ?", timestamp).
|
33
39
|
order("#{PaperTrail.timestamp_field} ASC, #{self.primary_key} ASC")
|
34
40
|
}
|
35
41
|
|
36
42
|
scope :between, lambda { |start_time, end_time|
|
37
|
-
where(
|
43
|
+
where("#{PaperTrail.timestamp_field} > ? AND #{PaperTrail.timestamp_field} < ?", start_time, end_time).
|
38
44
|
order("#{PaperTrail.timestamp_field} ASC, #{self.primary_key} ASC")
|
39
45
|
}
|
40
46
|
|
@@ -72,6 +78,8 @@ class Version < ActiveRecord::Base
|
|
72
78
|
|
73
79
|
if item
|
74
80
|
model = item
|
81
|
+
# Look for attributes that exist in the model and not in this version. These attributes should be set to nil.
|
82
|
+
(model.attribute_names - attrs.keys).each { |k| attrs[k] = nil }
|
75
83
|
else
|
76
84
|
inheritance_column_name = item_type.constantize.inheritance_column
|
77
85
|
class_name = attrs[inheritance_column_name].blank? ? item_type : attrs[inheritance_column_name]
|
@@ -80,6 +88,8 @@ class Version < ActiveRecord::Base
|
|
80
88
|
end
|
81
89
|
|
82
90
|
model.class.unserialize_attributes_for_paper_trail attrs
|
91
|
+
|
92
|
+
# Set all the attributes in this version on the model
|
83
93
|
attrs.each do |k, v|
|
84
94
|
if model.respond_to?("#{k}=")
|
85
95
|
model[k.to_sym] = v
|
@@ -176,4 +186,13 @@ class Version < ActiveRecord::Base
|
|
176
186
|
end
|
177
187
|
end
|
178
188
|
|
189
|
+
# checks to see if a value has been set for the `version_limit` config option, and if so enforces it
|
190
|
+
def enforce_version_limit!
|
191
|
+
return unless PaperTrail.config.version_limit.is_a? Numeric
|
192
|
+
previous_versions = sibling_versions.not_creates
|
193
|
+
return unless previous_versions.size > PaperTrail.config.version_limit
|
194
|
+
excess_previous_versions = previous_versions - previous_versions.last(PaperTrail.config.version_limit)
|
195
|
+
excess_previous_versions.map(&:destroy)
|
196
|
+
end
|
197
|
+
|
179
198
|
end
|
data/paper_trail.gemspec
CHANGED
@@ -20,6 +20,12 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
s.add_development_dependency 'rake'
|
22
22
|
s.add_development_dependency 'shoulda', '~> 3.3'
|
23
|
-
s.add_development_dependency '
|
24
|
-
s.add_development_dependency 'ffaker',
|
23
|
+
s.add_development_dependency 'shoulda-matchers', '~> 1.5'
|
24
|
+
s.add_development_dependency 'ffaker', '>= 1.15'
|
25
|
+
# JRuby support for the test ENV
|
26
|
+
unless defined?(JRUBY_VERSION)
|
27
|
+
s.add_development_dependency 'sqlite3', '~> 1.2'
|
28
|
+
else
|
29
|
+
s.add_development_dependency 'activerecord-jdbcsqlite3-adapter', '~> 1.2.9'
|
30
|
+
end
|
25
31
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This custom serializer excludes nil values
|
2
|
+
module CustomJsonSerializer
|
3
|
+
extend PaperTrail::Serializers::Json
|
4
|
+
|
5
|
+
def self.load(string)
|
6
|
+
parsed_value = super(string)
|
7
|
+
parsed_value.is_a?(Hash) ? parsed_value.reject { |k,v| k.blank? || v.blank? } : parsed_value
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.dump(object)
|
11
|
+
object.is_a?(Hash) ? super(object.reject { |k,v| v.nil? }) : super
|
12
|
+
end
|
13
|
+
end
|
data/test/unit/model_test.rb
CHANGED
@@ -628,6 +628,15 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
|
628
628
|
should 'return the current object for version_at after latest update' do
|
629
629
|
assert_equal 'Digit', @widget.version_at(1.day.from_now).name
|
630
630
|
end
|
631
|
+
|
632
|
+
context 'passing in a string representation of a timestamp' do
|
633
|
+
should 'still return a widget when appropriate' do
|
634
|
+
# need to add 1 second onto the timestamps before casting to a string, since casting a Time to a string drops the microseconds
|
635
|
+
assert_equal 'Widget', @widget.version_at((@created + 1.second).to_s).name
|
636
|
+
assert_equal 'Fidget', @widget.version_at((@first_update + 1.second).to_s).name
|
637
|
+
assert_equal 'Digit', @widget.version_at((@second_update + 1.second).to_s).name
|
638
|
+
end
|
639
|
+
end
|
631
640
|
end
|
632
641
|
|
633
642
|
context '.versions_between' do
|
@@ -882,7 +891,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
|
882
891
|
end
|
883
892
|
end
|
884
893
|
|
885
|
-
context 'where the
|
894
|
+
context 'where the association is created between model versions' do
|
886
895
|
setup do
|
887
896
|
@wotsit = @widget.create_wotsit :name => 'wotsit_0'
|
888
897
|
make_last_version_earlier @wotsit
|
@@ -1203,6 +1212,76 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
|
1203
1212
|
end
|
1204
1213
|
end
|
1205
1214
|
|
1215
|
+
context 'custom events' do
|
1216
|
+
context 'on create' do
|
1217
|
+
setup do
|
1218
|
+
Fluxor.reset_callbacks :create
|
1219
|
+
Fluxor.reset_callbacks :update
|
1220
|
+
Fluxor.reset_callbacks :destroy
|
1221
|
+
Fluxor.instance_eval <<-END
|
1222
|
+
has_paper_trail :on => [:create]
|
1223
|
+
END
|
1224
|
+
@fluxor = Fluxor.new.tap { |model| model.paper_trail_event = 'created' }
|
1225
|
+
@fluxor.update_attributes :name => 'blah'
|
1226
|
+
@fluxor.destroy
|
1227
|
+
end
|
1228
|
+
should 'only have a version for the created event' do
|
1229
|
+
assert_equal 1, @fluxor.versions.length
|
1230
|
+
assert_equal 'created', @fluxor.versions.last.event
|
1231
|
+
end
|
1232
|
+
end
|
1233
|
+
context 'on update' do
|
1234
|
+
setup do
|
1235
|
+
Fluxor.reset_callbacks :create
|
1236
|
+
Fluxor.reset_callbacks :update
|
1237
|
+
Fluxor.reset_callbacks :destroy
|
1238
|
+
Fluxor.instance_eval <<-END
|
1239
|
+
has_paper_trail :on => [:update]
|
1240
|
+
END
|
1241
|
+
@fluxor = Fluxor.create.tap { |model| model.paper_trail_event = 'name_updated' }
|
1242
|
+
@fluxor.update_attributes :name => 'blah'
|
1243
|
+
@fluxor.destroy
|
1244
|
+
end
|
1245
|
+
should 'only have a version for the name_updated event' do
|
1246
|
+
assert_equal 1, @fluxor.versions.length
|
1247
|
+
assert_equal 'name_updated', @fluxor.versions.last.event
|
1248
|
+
end
|
1249
|
+
end
|
1250
|
+
context 'on destroy' do
|
1251
|
+
setup do
|
1252
|
+
Fluxor.reset_callbacks :create
|
1253
|
+
Fluxor.reset_callbacks :update
|
1254
|
+
Fluxor.reset_callbacks :destroy
|
1255
|
+
Fluxor.instance_eval <<-END
|
1256
|
+
has_paper_trail :on => [:destroy]
|
1257
|
+
END
|
1258
|
+
@fluxor = Fluxor.create.tap { |model| model.paper_trail_event = 'destroyed' }
|
1259
|
+
@fluxor.update_attributes :name => 'blah'
|
1260
|
+
@fluxor.destroy
|
1261
|
+
end
|
1262
|
+
should 'only have a version for the destroy event' do
|
1263
|
+
assert_equal 1, @fluxor.versions.length
|
1264
|
+
assert_equal 'destroyed', @fluxor.versions.last.event
|
1265
|
+
end
|
1266
|
+
end
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
context '`PaperTrail::Config.version_limit` set' do
|
1270
|
+
setup do
|
1271
|
+
PaperTrail.config.version_limit = 2
|
1272
|
+
@widget = Widget.create! :name => 'Henry'
|
1273
|
+
6.times { @widget.update_attribute(:name, Faker::Lorem.word) }
|
1274
|
+
end
|
1275
|
+
|
1276
|
+
teardown { PaperTrail.config.version_limit = nil }
|
1277
|
+
|
1278
|
+
should "limit the number of versions to 3 (2 plus the created at event)" do
|
1279
|
+
assert_equal 'create', @widget.versions.first.event
|
1280
|
+
assert_equal 3, @widget.versions.size
|
1281
|
+
end
|
1282
|
+
end
|
1283
|
+
|
1284
|
+
|
1206
1285
|
private
|
1207
1286
|
|
1208
1287
|
# Updates `model`'s last version so it looks like the version was
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
|
+
require 'custom_json_serializer'
|
2
3
|
|
3
4
|
class SerializerTest < ActiveSupport::TestCase
|
4
5
|
|
@@ -29,7 +30,7 @@ class SerializerTest < ActiveSupport::TestCase
|
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
32
|
-
context '
|
33
|
+
context 'JSON Serializer' do
|
33
34
|
setup do
|
34
35
|
PaperTrail.configure do |config|
|
35
36
|
config.serializer = PaperTrail::Serializers::Json
|
@@ -48,7 +49,7 @@ class SerializerTest < ActiveSupport::TestCase
|
|
48
49
|
PaperTrail.config.serializer = PaperTrail::Serializers::Yaml
|
49
50
|
end
|
50
51
|
|
51
|
-
should 'reify with
|
52
|
+
should 'reify with JSON serializer' do
|
52
53
|
# Normal behaviour
|
53
54
|
assert_equal 2, @fluxor.versions.length
|
54
55
|
assert_nil @fluxor.versions[0].reify
|
@@ -71,4 +72,46 @@ class SerializerTest < ActiveSupport::TestCase
|
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
75
|
+
context 'Custom Serializer' do
|
76
|
+
setup do
|
77
|
+
PaperTrail.configure do |config|
|
78
|
+
config.serializer = CustomJsonSerializer
|
79
|
+
end
|
80
|
+
|
81
|
+
Fluxor.instance_eval <<-END
|
82
|
+
has_paper_trail
|
83
|
+
END
|
84
|
+
|
85
|
+
@fluxor = Fluxor.create
|
86
|
+
@original_fluxor_attributes = @fluxor.send(:item_before_change).attributes.reject { |k,v| v.nil? } # this is exactly what PaperTrail serializes
|
87
|
+
@fluxor.update_attributes :name => 'Some more text.'
|
88
|
+
end
|
89
|
+
|
90
|
+
teardown do
|
91
|
+
PaperTrail.config.serializer = PaperTrail::Serializers::Yaml
|
92
|
+
end
|
93
|
+
|
94
|
+
should 'reify with custom serializer' do
|
95
|
+
# Normal behaviour
|
96
|
+
assert_equal 2, @fluxor.versions.length
|
97
|
+
assert_nil @fluxor.versions[0].reify
|
98
|
+
assert_nil @fluxor.versions[1].reify.name
|
99
|
+
|
100
|
+
# Check values are stored as JSON.
|
101
|
+
assert_equal @original_fluxor_attributes, ActiveSupport::JSON.decode(@fluxor.versions[1].object)
|
102
|
+
# This test can't consistently pass in Ruby1.8 because hashes do no preserve order, which means the order of the
|
103
|
+
# attributes in the JSON can't be ensured.
|
104
|
+
if RUBY_VERSION.to_f >= 1.9
|
105
|
+
assert_equal ActiveSupport::JSON.encode(@original_fluxor_attributes), @fluxor.versions[1].object
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
should 'store object_changes' do
|
110
|
+
initial_changeset = {"id" => [nil, 1]}
|
111
|
+
second_changeset = {"name"=>[nil, "Some more text."]}
|
112
|
+
assert_equal initial_changeset, @fluxor.versions[0].changeset
|
113
|
+
assert_equal second_changeset, @fluxor.versions[1].changeset
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
74
117
|
end
|
@@ -1,17 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
|
-
|
3
|
-
module CustomJsonSerializer
|
4
|
-
extend PaperTrail::Serializers::Json
|
5
|
-
|
6
|
-
def self.load(string)
|
7
|
-
parsed_value = super(string)
|
8
|
-
parsed_value.is_a?(Hash) ? parsed_value.reject { |k,v| k.blank? || v.blank? } : parsed_value
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.dump(object)
|
12
|
-
object.is_a?(Hash) ? super(object.reject { |k,v| v.nil? }) : super
|
13
|
-
end
|
14
|
-
end
|
2
|
+
require 'custom_json_serializer'
|
15
3
|
|
16
4
|
class MixinJsonTest < ActiveSupport::TestCase
|
17
5
|
|
data/test/unit/version_test.rb
CHANGED
@@ -40,4 +40,18 @@ class VersionTest < ActiveSupport::TestCase
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
|
+
|
44
|
+
context "Version.not_creates" do
|
45
|
+
setup {
|
46
|
+
@article.update_attributes(:name => 'Animal')
|
47
|
+
@article.destroy
|
48
|
+
assert Version.not_creates.present?
|
49
|
+
}
|
50
|
+
|
51
|
+
should "return all items except create events" do
|
52
|
+
Version.not_creates.each do |version|
|
53
|
+
assert_not_equal "create", version.event
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
43
57
|
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paper_trail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
5
|
-
prerelease:
|
4
|
+
version: 2.7.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Andy Stewart
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-05-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: railties
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: activerecord
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: shoulda
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,31 +62,27 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '3.3'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
|
-
name:
|
70
|
+
name: shoulda-matchers
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ~>
|
84
74
|
- !ruby/object:Gem::Version
|
85
|
-
version: '1.
|
75
|
+
version: '1.5'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ~>
|
92
81
|
- !ruby/object:Gem::Version
|
93
|
-
version: '1.
|
82
|
+
version: '1.5'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: ffaker
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ! '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,11 +90,24 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ! '>='
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '1.15'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: sqlite3
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.2'
|
110
111
|
description: Track changes to your models' data. Good for auditing or versioning.
|
111
112
|
email: boss@airbladesoftware.com
|
112
113
|
executables: []
|
@@ -133,6 +134,7 @@ files:
|
|
133
134
|
- lib/paper_trail/version.rb
|
134
135
|
- lib/paper_trail/version_number.rb
|
135
136
|
- paper_trail.gemspec
|
137
|
+
- test/custom_json_serializer.rb
|
136
138
|
- test/dummy/Rakefile
|
137
139
|
- test/dummy/app/controllers/application_controller.rb
|
138
140
|
- test/dummy/app/controllers/test_controller.rb
|
@@ -204,29 +206,29 @@ files:
|
|
204
206
|
- test/unit/version_test.rb
|
205
207
|
homepage: http://github.com/airblade/paper_trail
|
206
208
|
licenses: []
|
209
|
+
metadata: {}
|
207
210
|
post_install_message:
|
208
211
|
rdoc_options: []
|
209
212
|
require_paths:
|
210
213
|
- lib
|
211
214
|
required_ruby_version: !ruby/object:Gem::Requirement
|
212
|
-
none: false
|
213
215
|
requirements:
|
214
216
|
- - ! '>='
|
215
217
|
- !ruby/object:Gem::Version
|
216
218
|
version: '0'
|
217
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
|
-
none: false
|
219
220
|
requirements:
|
220
221
|
- - ! '>='
|
221
222
|
- !ruby/object:Gem::Version
|
222
223
|
version: '0'
|
223
224
|
requirements: []
|
224
225
|
rubyforge_project:
|
225
|
-
rubygems_version:
|
226
|
+
rubygems_version: 2.0.3
|
226
227
|
signing_key:
|
227
|
-
specification_version:
|
228
|
+
specification_version: 4
|
228
229
|
summary: Track changes to your models' data. Good for auditing or versioning.
|
229
230
|
test_files:
|
231
|
+
- test/custom_json_serializer.rb
|
230
232
|
- test/dummy/Rakefile
|
231
233
|
- test/dummy/app/controllers/application_controller.rb
|
232
234
|
- test/dummy/app/controllers/test_controller.rb
|