Skip to content

Commit

Permalink
Don't stomp on the revisiable_number setup work already done corectly.
Browse files Browse the repository at this point in the history
The revisable_number is altered a second time in the revision_setup before_create callback, after already
being set up correctly in the revisable's to_revision method.  This results in duplicate revisable
numbers after the first revision, and incorrect numbers thereafter.
  • Loading branch information
moklett authored and Rich Cavanaugh committed Sep 19, 2009
1 parent 93c28fd commit c7cd06e
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/acts_as_revisable/acts/revision.rb
Expand Up @@ -72,7 +72,6 @@ def revision_setup #:nodoc:
self[:revisable_is_current] = false
self[:revisable_branched_from_id] = current_revision[:revisable_branched_from_id]
self[:revisable_type] = current_revision[:type] || current_revision.class.name
self[:revisable_number] = (self.class.maximum(:revisable_number, :conditions => {:revisable_original_id => self[:revisable_original_id]}) || 0) + 1
end

def grab_my_branches
Expand Down

0 comments on commit c7cd06e

Please sign in to comment.