Browse files

Added changes and renamed versions to comment versions

  • Loading branch information...
1 parent da0c2fd commit ea4fceb1135d50fffea1521a0f5390e491af1ad6 Ian Ownbey committed Oct 27, 2008
View
8 app/models/comment_version.rb
@@ -0,0 +1,8 @@
+class CommentVersion < ActiveRecord::Base
+ belongs_to :user
+ belongs_to :code_comment
+
+ named_scope :recent, :order => ['created_at DESC']
+ named_scope :before, lambda {|num| {:conditions => ['version < ?', num]} }
+ named_scope :acceptable, :conditions => ['skip IS false']
+end
View
8 config/docbox.yml
@@ -1,6 +1,6 @@
+---
+auto_push: true
+branch: docs
+git_url: git@github.com:iownbey/docbox-sample-app.git
site_name: Docbox Sample App
-auto_push: false
-git_branch: docs
wrap_number: 80
-
-git_html_url: http://github.com/rails/rails
View
16 db/migrate/20080503005750_create_comment_versions.rb
@@ -0,0 +1,16 @@
+class CreateCommentVersions < ActiveRecord::Migration
+ def self.up
+ create_table :comment_versions do |t|
+ t.text :body
+ t.string :commit, :length => 40
+ t.integer :user_id, :code_comment_id, :version
+ t.boolean :exported, :uses_begin, :skip, :default => false
+
+ t.datetime :created_at
+ end
+ end
+
+ def self.down
+ drop_table :comment_versions
+ end
+end
View
9 db/migrate/20081025002723_create_changes.rb
@@ -1,8 +1,13 @@
class CreateChanges < ActiveRecord::Migration
def self.up
create_table :changes do |t|
-
- t.timestamps
+ t.integer :owner_id, :change_id
+ t.string :owner_type, :change_type
+
+ # Tagging
+ # t.integer :tag_id
+
+ t.datetime :created_at
end
end

0 comments on commit ea4fceb

Please sign in to comment.