Skip to content
Browse files

Update method to use 'tap' instead of 'returning'

  • Loading branch information...
1 parent 072a397 commit a69afb046433b198058b1635c4a9279ace1563e1 @chargify-pair chargify-pair committed Jun 28, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/acts_as_revisable/acts/deletable.rb
View
12 lib/acts_as_revisable/acts/deletable.rb
@@ -6,25 +6,25 @@ def self.included(base)
define_callbacks :before_revise_on_destroy, :after_revise_on_destroy
end
end
-
+
def destroy
now = Time.current
-
+
prev = self.revisions.first
self.revisable_deleted_at = now
self.revisable_is_current = false
-
+
self.revisable_current_at = if prev
prev.update_attribute(:revisable_revised_at, now)
prev.revisable_revised_at + 1.second
else
self.created_at
end
-
+
self.revisable_revised_at = self.revisable_deleted_at
-
+
return false unless run_callbacks(:before_revise_on_destroy)
- returning(self.save(:without_revision => true)) do
+ (self.save(:without_revision => true)).tap do
run_callbacks(:after_revise_on_destroy)
end
end

0 comments on commit a69afb0

Please sign in to comment.
Something went wrong with that request. Please try again.