lib/ab_admin/concerns/silencer.rb in ab_admin-0.3.6 vs lib/ab_admin/concerns/silencer.rb in ab_admin-0.4.0

- old
+ new

@@ -1,26 +1,26 @@ # -*- encoding : utf-8 -*- module AbAdmin module Concerns module Silencer - def no_timestamps(&block) + def no_timestamps original_setting = ActiveRecord::Base.record_timestamps ActiveRecord::Base.record_timestamps = false begin yield ensure ActiveRecord::Base.record_timestamps = original_setting end end - def no_versions(&block) - original_setting = PaperTrail.enabled? - PaperTrail.enabled = false + def no_versions + original_setting = Track.tracking_enabled + Track.tracking_enabled = false begin yield ensure - PaperTrail.enabled = original_setting + Track.tracking_enabled = original_setting end end def full_silence(&block) no_timestamps do \ No newline at end of file