<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Capfile</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -11,4 +11,4 @@ test
 coverage
 coverage/*
 config/*.sphinx.conf
-
+config/deploy.rb</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -2,19 +2,19 @@ class PostsController &lt; ApplicationController
   before_filter :login_required
   
   def new
-     @topic = Topic.find(params[:topic_id], :include =&gt; :posts)
-     #is there an easier way to do this?
-     @posts = @topic.last_10_posts
-     @post = @topic.posts.build(:user =&gt; current_user)
-     if params[:quote]
-       @quoting_post = Post.find(params[:quote])
-       @post.text = &quot;[quote=\&quot;&quot; + @quoting_post.user.login + &quot;\&quot;]&quot; + @quoting_post.text + &quot;[/quote]&quot;
-     end
-   end
+    @topic = Topic.find(params[:topic_id], :include =&gt; :posts)
+    #is there an easier way to do this?
+    @posts = @topic.last_10_posts
+    @post = @topic.posts.build(:user =&gt; current_user)
+    if params[:quote]
+      @quoting_post = Post.find(params[:quote])
+      @post.text = &quot;[quote=\&quot;&quot; + @quoting_post.user.login + &quot;\&quot;]&quot; + @quoting_post.text + &quot;[/quote]&quot;
+    end
+  end
 
   def create
     @topic = Topic.find(params[:topic_id], :include =&gt; :posts)
-    @posts = is_admin? ? @topic.posts : @topic.user_posts
+    @posts = @topic.posts
     @posts = @posts.find(:all, :order =&gt; &quot;id DESC&quot;, :limit =&gt; 10)
     @post = @posts.build(params[:post].merge!(:user =&gt; current_user))
     if @post.save
@@ -55,14 +55,13 @@ class PostsController &lt; ApplicationController
   def destroy
     @post = Post.find(params[:id])
     @post.destroy
-      flash[:notice] = &quot;Post was deleted.&quot;
-      if @post.topic.posts.size.zero?
-        @post.topic.destroy
-        flash[:notice] += &quot; This was the only post in the topic, so topic was deleted also.&quot;
-        redirect_to forum_path(@post.forum)
-      else
-        redirect_to forum_topic_path(@post.forum, @post.topic)
-      end
+    flash[:notice] = &quot;Post was deleted.&quot;
+    if @post.topic.posts.size.zero?
+      @post.topic.destroy
+      flash[:notice] += &quot; This was the only post in the topic, so topic was deleted also.&quot;
+      redirect_to forum_path(@post.forum)
+    else
+      redirect_to forum_topic_path(@post.forum, @post.topic)
     end
   rescue ActiveRecord::RecordNotFound
     not_found</diff>
      <filename>app/controllers/posts_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,8 @@ class TopicsController &lt; ApplicationController
    end
   
   def new
+    check_ownership
+    puts &quot;I SHOULD NEVER APPEAR&quot;
     @topic = Topic.new
     @post = @topic.posts.build
   end
@@ -118,6 +120,10 @@ class TopicsController &lt; ApplicationController
     end
   end
   
+  def check_ownership
+     redirect_to root_path and return false
+  end
+  
   def find_forum
     @forum = Forum.find(params[:forum_id]) if params[:forum_id]
   end</diff>
      <filename>app/controllers/topics_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -62,6 +62,11 @@ class Forum &lt; ActiveRecord::Base
     list.compact
   end
   
+  def self.woot
+    callback :after_woot
+  end
+  
+  
   def sub?
     !parent_id.nil?
   end</diff>
      <filename>app/models/forum.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,9 +24,16 @@ class Topic &lt; ActiveRecord::Base
     new_forum = Forum.find(new_forum_id)
     update_attribute(&quot;forum_id&quot;, new_forum_id)
     is_new_last_post = new_forum.last_post.nil? || (new_forum.last_post.created_at &lt;= posts.last.created_at)
-    new_forum.update_last_post(new_forum, posts.last) if is_new_last_post
-    old_forum.reload
-    old_forum.update_last_post(new_forum) if was_old_last_post
+    if is_new_last_post
+      puts &quot;UPDATING LAST POST FOR #{new_forum}&quot;
+      new_forum.update_last_post(new_forum, posts.last)
+    end
+    
+    if was_old_last_post
+      old_forum.reload
+      puts &quot;UPDATING LAST POST FOR #{old_forum}&quot;
+      old_forum.update_last_post(new_forum)
+    end
   end
   
   def lock!</diff>
      <filename>app/models/topic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ require File.join(File.dirname(__FILE__), 'boot')
 Rails::Initializer.run do |config|
 
   # Settings in config/environments/* take precedence over those specified here
-  
+  config.gem 'chronic'
   # Skip frameworks you're not going to use (only works if using vendor/rails)
   # config.frameworks -= [ :action_web_service, :action_mailer ]
 config.action_controller.session = { :session_key =&gt; &quot;rboard_secret&quot;, :secret =&gt; &quot;this is a super secret passphrase that protects rboard&quot; }
@@ -40,7 +40,7 @@ config.action_controller.session = { :session_key =&gt; &quot;rboard_secret&quot;, :secret =&gt;
   # config.active_record.schema_format = :sql
 
   # Activate observers that should always be running
-  # config.active_record.observers = :cacher, :garbage_collector
+  #config.active_record.observers = :forum_observer
 
   # Make Active Record use UTC-base instead of local time
   # config.active_record.default_timezone = :utc</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,11 +13,9 @@ ActionController::Routing::Routes.draw do |map|
     admin.resources :accounts, :collection =&gt; { :ban_ip =&gt; :any }, :member =&gt; { :ban =&gt; :any, :ban_ip =&gt; :any }
     admin.resources :themes, :member =&gt; { :make_default =&gt; :put }
     admin.resources :forums, :member =&gt; { :move_up =&gt; :put, :move_down =&gt; :put, :move_to_top =&gt; :put, :move_to_bottom =&gt; :put  }
+    admin.chronic 'chronic', :controller =&gt; 'chronic'
   end
   
-  #FIXME
-  map.connect '/admin/chronic', :controller =&gt; &quot;/admin/chronic&quot;
- 
   map.resources :forums, :collection =&gt; { :list =&gt; :get } do |forum|
     forum.resources :topics, :collection =&gt; { :moderate =&gt; :post }, :member =&gt; { :lock =&gt; :put, :unlock =&gt; :put }
   end</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,7 @@ user_3:
   subject: Fifth topic!
   user: plebian
   forum: sub_of_everybody
+  last_post: user_3
   
 invalid:
   id: 4</diff>
      <filename>spec/fixtures/topics.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,13 @@
 require File.dirname(__FILE__) + '/../spec_helper'
-describe Topic, &quot;creation&quot; do
+describe Topic, &quot;in general&quot; do
   fixtures :topics, :forums
   before do
     @topic = mock(&quot;topic&quot;)
     @forum = mock(&quot;forum&quot;)
     @invalid_topic = topics(:invalid)
-    @valid_topic = topics(:user)
+    @valid_topic = topics(:user_3)
     @everybody = forums(:everybody)
+    @sub_of_everybody = forums(:sub_of_everybody)
     @admins_only = forums(:admins_only)
     # Remove the call to reverse for an interesting failing test
     @posts = @valid_topic.posts.reverse
@@ -43,7 +44,7 @@ describe Topic, &quot;creation&quot; do
   end
   
   it &quot;should be able to show the string version&quot; do
-    @valid_topic.to_s.should eql(&quot;Third topic!&quot;)
+    @valid_topic.to_s.should eql(&quot;Fifth topic!&quot;)
   end
   
   it &quot;should be able to lock a topic&quot; do
@@ -72,4 +73,17 @@ describe Topic, &quot;creation&quot; do
     @valid_topic.should_not be_sticky
   end
   
+  it &quot;should be able to move a topic from a sub-forum to a top-level forum&quot; do
+    @everybody.last_post.should eql(@valid_topic.last_post)
+    @valid_topic.forum.should eql(@sub_of_everybody)
+    @valid_topic.move!(@admins_only.id)
+    @valid_topic.forum_id.should eql(@admins_only.id)
+    @sub_of_everybody.last_post_id.should be_nil
+    @everybody.last_post.should_not eql(@valid_topic.last_post)
+    @admins_only.reload
+    @admins_only.last_post.should eql(@valid_topic.last_post)
+  end
+  
+  
+  
 end</diff>
      <filename>spec/models/topic_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>570c4a9a61e12c4fbf49c4f88c66b3e26ec2dfae</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Bigg</name>
    <email>radarlistener@gmail.com</email>
  </author>
  <url>http://github.com/radar/rboard/commit/0d63219efc21fa6515f29acf632370bb76d4b7b2</url>
  <id>0d63219efc21fa6515f29acf632370bb76d4b7b2</id>
  <committed-date>2008-09-03T04:22:16-07:00</committed-date>
  <authored-date>2008-09-03T04:22:16-07:00</authored-date>
  <message>Added new stuff.</message>
  <tree>1875f17c953071fc8e4c33a6f1059f869c33ee78</tree>
  <committer>
    <name>Ryan Bigg</name>
    <email>radarlistener@gmail.com</email>
  </committer>
</commit>
