diff --git a/lib/paper_trail.rb b/lib/paper_trail.rb index 7946c0ce..69bca41e 100644 --- a/lib/paper_trail.rb +++ b/lib/paper_trail.rb @@ -95,17 +95,7 @@ module PaperTrail end def self.transaction? - ActiveRecord::Base.connection.open_transactions > 0 || paper_trail_store[:transaction_open] - end - - def self.start_transaction - paper_trail_store[:transaction_open] = true - self.transaction_id = nil - end - - def self.end_transaction - paper_trail_store[:transaction_open] = false - self.transaction_id = nil + ActiveRecord::Base.connection.open_transactions > 0 end def self.transaction_id diff --git a/lib/paper_trail/version_concern.rb b/lib/paper_trail/version_concern.rb index e9912144..dfbe8f78 100644 --- a/lib/paper_trail/version_concern.rb +++ b/lib/paper_trail/version_concern.rb @@ -171,10 +171,6 @@ module PaperTrail model.send "#{model.class.version_association_name}=", self - # unless options[:has_one] == false - # reify_has_ones model, options[:has_one] - # end - unless options[:has_one] == false reify_has_ones model, options end @@ -200,15 +196,6 @@ module PaperTrail {} end - # Rollback all changes within a transaction - def rollback - transaction do - self.class.within_transaction(transaction_id).reverse_each do |version| - version.reify.save! - end - end - end - # Returns who put the item into the state stored in this version. def originator @originator ||= previous.whodunnit rescue nil