Module: RSpec::PaperTrailExtensions

Defined in:
lib/rspec/paper_trail/extensions.rb

Instance Method Summary collapse

Instance Method Details

#with_versioningObject

:call-seq: with_versioning

enable versioning for specific blocks



11
12
13
14
15
16
17
18
19
# File 'lib/rspec/paper_trail/extensions.rb', line 11

def with_versioning
  was_enabled = ::PaperTrail.enabled?
  ::PaperTrail.enabled = true
  begin
    yield
  ensure
    ::PaperTrail.enabled = was_enabled
  end
end