File tree 4 files changed +15
-12
lines changed
4 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
## 3.0.0 (Unreleased)
2
2
3
+ - [ #264 ] ( https://github.com/airblade/paper_trail/pull/264 ) - Allow unwrapped symbol to be passed in to the ` on ` option.
3
4
- [ #224 ] ( https://github.com/airblade/paper_trail/issues/224 ) /[ #236 ] ( https://github.com/airblade/paper_trail/pull/236 ) -
4
5
Fixed compatibility with [ ActsAsTaggableOn] ( https://github.com/mbleigh/acts-as-taggable-on ) .
5
6
- [ #235 ] ( https://github.com/airblade/paper_trail/pull/235 ) - Dropped unnecessary secondary sort on ` versions ` association.
9
10
- [ #207 ] ( https://github.com/airblade/paper_trail/issues/207 ) - Versions for ` 'create' ` events are now created with ` create! ` instead of
10
11
` create ` so that an exception gets raised if it is appropriate to do so.
11
12
- [ #199 ] ( https://github.com/airblade/paper_trail/pull/199 ) - Rails 4 compatibility.
12
- - [ #165 ] ( https://github.com/airblade/paper_trail/pull/165 ) - Namespaced the version class under the ` PaperTrail ` module.
13
+ - [ #165 ] ( https://github.com/airblade/paper_trail/pull/165 ) - Namespaced the ` Version ` class under the ` PaperTrail ` module.
13
14
- [ #119 ] ( https://github.com/airblade/paper_trail/issues/119 ) - Support for [ Sinatra] ( http://www.sinatrarb.com/ ) ; decoupled gem from ` Rails ` .
14
15
15
16
## 2.7.2
Original file line number Diff line number Diff line change @@ -15,10 +15,7 @@ desc 'Run PaperTrail specs for the RSpec helper.'
15
15
RSpec ::Core ::RakeTask . new ( :spec )
16
16
17
17
desc 'Run all available test suites'
18
- task :run_all_tests do
19
- system ( 'rake test' )
20
- system ( 'rake spec' )
21
- end
18
+ task :run_all_tests => [ :test , :spec ]
22
19
23
20
desc 'Default: run unit tests.'
24
21
task :default => :run_all_tests
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def has_paper_trail(options = {})
70
70
:order => "#{ PaperTrail . timestamp_field } ASC"
71
71
end
72
72
73
- options_on = Array ( options [ :on ] )
73
+ options_on = Array ( options [ :on ] ) # so that a single symbol can be passed in without wrapping it in an `Array`
74
74
after_create :record_create , :if => :save_version? if options_on . empty? || options_on . include? ( :create )
75
75
before_update :record_update , :if => :save_version? if options_on . empty? || options_on . include? ( :update )
76
76
after_destroy :record_destroy , :if => :save_version? if options_on . empty? || options_on . include? ( :destroy )
Original file line number Diff line number Diff line change @@ -1177,12 +1177,17 @@ def without(&block)
1177
1177
end
1178
1178
end
1179
1179
context 'allows a symbol to be passed' do
1180
- Fluxor . reset_callbacks :create
1181
- Fluxor . reset_callbacks :update
1182
- Fluxor . reset_callbacks :destroy
1183
- Fluxor . instance_evail <<-END
1184
- has_paper_trail :on => :create
1185
- END
1180
+ setup do
1181
+ Fluxor . reset_callbacks :create
1182
+ Fluxor . reset_callbacks :update
1183
+ Fluxor . reset_callbacks :destroy
1184
+ Fluxor . instance_eval <<-END
1185
+ has_paper_trail :on => :create
1186
+ END
1187
+ @fluxor = Fluxor . create
1188
+ @fluxor . update_attributes :name => 'blah'
1189
+ @fluxor . destroy
1190
+ end
1186
1191
should 'only have a version for hte create event' do
1187
1192
assert_equal 1 , @fluxor . versions . length
1188
1193
assert_equal 'create' , @fluxor . versions . last . event
You can’t perform that action at this time.
0 commit comments