public
Rubygem
Description: acts_as_revisable enables revision tracking, querying, reverting and branching of ActiveRecord models. Inspired by acts_as_versioned.
Clone URL: git://github.com/fatjam/acts_as_revisable.git
Search Repo:
branches should follow the revision they were built from
rich (author)
Mon Jul 21 11:44:08 -0700 2008
commit  97fc9feab2b3e4eecc578c6bae5fe162d03b871d
tree    0a0871fc101465c64bc0d671ca41c0f3d2c9e041
parent  436c480470a71aefe8e526cf0dc88d9b5dcc9764
...
1
 
 
 
 
2
3
4
5
6
7
8
9
10
11
 
12
13
...
1
2
3
4
5
6
7
8
9
10
 
 
 
 
 
11
12
13
0
@@ -1,12 +1,12 @@
0
 Gem::Specification.new do |s|
0
+ s.rdoc_options = ["--main", "README.rdoc"]
0
+ s.summary = "acts_as_revisable enables revision tracking, querying, reverting and branching of ActiveRecord models. Inspired by acts_as_versioned."
0
+ s.name = "acts_as_revisable"
0
+ s.version = "0.9.6"
0
   s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
0
   s.email = "cavanaugh@fatjam.com"
0
   s.has_rdoc = true
0
   s.homepage = "http://github.com/fatjam/acts_as_revisable/tree/master"
0
   s.authors = ["Rich Cavanaugh of JamLab, LLC.", "Stephen Caudill of JamLab, LLC."]
0
- s.name = "acts_as_revisable"
0
- s.files = ["LICENSE", "README.rdoc", "Rakefile", "spec/associations_spec.rb", "spec/branch_spec.rb", "spec/find_spec.rb", "spec/general_spec.rb", "spec/options_spec.rb", "spec/quoted_columns_spec.rb", "spec/revert_spec.rb", "spec/revisable_spec.rb", "spec/revision_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "lib/acts_as_revisable", "lib/acts_as_revisable/acts", "lib/acts_as_revisable/acts/common.rb", "lib/acts_as_revisable/acts/deletable.rb", "lib/acts_as_revisable/acts/revisable.rb", "lib/acts_as_revisable/acts/revision.rb", "lib/acts_as_revisable/acts/scoped_model.rb", "lib/acts_as_revisable/base.rb", "lib/acts_as_revisable/clone_associations.rb", "lib/acts_as_revisable/gem_spec_options.rb", "lib/acts_as_revisable/options.rb", "lib/acts_as_revisable/quoted_columns.rb", "lib/acts_as_revisable/version.rb", "lib/acts_as_revisable.rb", "generators/revisable_migration", "generators/revisable_migration/revisable_migration_generator.rb", "generators/revisable_migration/templates", "generators/revisable_migration/templates/migration.rb", "rails/init.rb"]
0
- s.version = "0.9.5"
0
- s.rdoc_options = ["--main", "README.rdoc"]
0
- s.summary = "acts_as_revisable enables revision tracking, querying, reverting and branching of ActiveRecord models. Inspired by acts_as_versioned."
0
+ s.files = ["LICENSE", "README.rdoc", "Rakefile", "spec/associations_spec.rb", "spec/branch_spec.rb", "spec/find_spec.rb", "spec/general_spec.rb", "spec/options_spec.rb", "spec/quoted_columns_spec.rb", "spec/revert_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "lib/acts_as_revisable", "lib/acts_as_revisable/acts", "lib/acts_as_revisable/acts/common.rb", "lib/acts_as_revisable/acts/deletable.rb", "lib/acts_as_revisable/acts/revisable.rb", "lib/acts_as_revisable/acts/revision.rb", "lib/acts_as_revisable/acts/scoped_model.rb", "lib/acts_as_revisable/base.rb", "lib/acts_as_revisable/clone_associations.rb", "lib/acts_as_revisable/gem_spec_options.rb", "lib/acts_as_revisable/options.rb", "lib/acts_as_revisable/quoted_columns.rb", "lib/acts_as_revisable/version.rb", "lib/acts_as_revisable.rb", "generators/revisable_migration", "generators/revisable_migration/revisable_migration_generator.rb", "generators/revisable_migration/templates", "generators/revisable_migration/templates/migration.rb", "rails/init.rb"]
0
 end
0
\ No newline at end of file
...
26
27
28
 
29
30
31
...
76
77
78
 
 
 
 
79
80
81
...
26
27
28
29
30
31
32
...
77
78
79
80
81
82
83
84
85
86
0
@@ -26,6 +26,7 @@ module FatJam
0
         
0
           define_callbacks :before_restore, :after_restore
0
           before_create :revision_setup
0
+ after_create :grab_my_branches
0
           
0
           [:current_revision, revisable_association_name.to_sym].each do |a|
0
             belongs_to a, :class_name => revisable_class_name, :foreign_key => :revisable_original_id
0
@@ -76,6 +77,10 @@ module FatJam
0
         self[:revisable_number] = (self.class.maximum(:revisable_number, :conditions => {:revisable_original_id => self[:revisable_original_id]}) || 0) + 1
0
       end
0
       
0
+ def grab_my_branches
0
+ self.class.revisable_class.update_all(["revisable_branched_from_id = ?", self[:id]], ["revisable_branched_from_id = ?", self[:revisable_original_id]])
0
+ end
0
+
0
       def from_revisable
0
         current_revision.for_revision
0
       end
...
3
4
5
6
 
7
8
9
...
3
4
5
 
6
7
8
9
0
@@ -3,7 +3,7 @@ module FatJam #:nodoc:
0
     module VERSION #:nodoc:
0
       MAJOR = 0
0
       MINOR = 9
0
- TINY = 5
0
+ TINY = 6
0
 
0
       STRING = [MAJOR, MINOR, TINY].join('.')
0
     end

Comments

    No one has commented yet.