<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -15,6 +15,3 @@ require 'shinmun/blog'
 require 'shinmun/routes'
 require 'shinmun/post'
 require 'shinmun/comment'
-
-require 'shinmun/aggregations/delicious'
-require 'shinmun/aggregations/flickr'</diff>
      <filename>lib/shinmun.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,17 +55,20 @@ module Shinmun
       store.tree('pages').values
     end
 
-    der posts
+    def posts
       store.tree('posts').values.sort_by { |post| post.date.to_s }.reverse
     end
 
     def call(env)
-      store.load if store.changed?
-      store.load(true) if ENV['RACK_ENV'] != 'production')
-        
+      if ENV['RACK_ENV'] == 'production'
+        store.load if store.changed?
+      else
+        store.load(true)
+      end
+      
       super
     end
-    
+
     def url
       &quot;http://#{request.host}&quot;
     end
@@ -146,7 +149,7 @@ module Shinmun
         :posts =&gt; posts.select { |p| p.category == name },
         :permalink =&gt; permalink }
     end
-    
+
     def recent_posts
       posts[0, 20]
     end
@@ -155,7 +158,7 @@ module Shinmun
     def posts_for_month(year, month)
       posts.select { |p| p.year == year and p.month == month }
     end
-    
+
     # Return all posts with any of given tags.
     def posts_with_tags(tags)
       return [] if tags.nil? or tags.empty?
@@ -172,7 +175,7 @@ module Shinmun
     def archives
       posts.map { |p| [p.year, p.month] }.uniq.sort
     end
-    
-  end  
+
+  end
   
 end</diff>
      <filename>lib/shinmun/blog.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,13 +20,16 @@ Shinmun::Blog.map do
       render 'post.rhtml', :post =&gt; post, :comments =&gt; comments
     else
       create_comment(post, params)
-      render 'post.rhtml', :post =&gt; post, :comments =&gt; comments_for(post)
+      redirect post_path(post)
     end
   end
 
   post '/(\d+)/(\d+)/(.*)' do |year, month, name|
-    post = find_post(year.to_i, month.to_i, name) or raise &quot;post not found #{request.path_info}&quot;
-    render 'post.rhtml', :post =&gt; post, :comments =&gt; comments_for(post)
+    if post = find_post(year.to_i, month.to_i, name)
+      render 'post.rhtml', :post =&gt; post, :comments =&gt; comments_for(post)
+    else
+      render '404.rhtml', :path =&gt; request.path_info
+    end
   end
 
   archive '/(\d+)/(\d+)' do |year, month|</diff>
      <filename>lib/shinmun/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,8 @@
     &lt;/p&gt;
     &lt;p&gt;
       &lt;input type=&quot;submit&quot; value=&quot;Post comment&quot;/&gt;
+      &lt;input type=&quot;checkbox&quot; name=&quot;preview&quot; value=&quot;1&quot;/&gt;
+      Preview
     &lt;/p&gt;
   &lt;/form&gt;
 &lt;/div&gt;</diff>
      <filename>templates/_comment_form.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@ describe Shinmun::Blog do
     @pages = [blog.create_page(:title =&gt; 'Page 1', :body =&gt; 'Body1'),
               blog.create_page(:title =&gt; 'Page 2', :body =&gt; 'Body2')]
 
-    blog.load
+    blog.store.load
   end
 
   def request(method, uri, options={})
@@ -86,7 +86,7 @@ describe Shinmun::Blog do
 
   it &quot;should create a post&quot; do
     post = blog.create_post(:title =&gt; 'New post', :date =&gt; '2008-10-10')
-    blog.load
+    blog.store.load
 
     post = blog.find_post(2008, 10, 'new-post')
     post.should_not be_nil
@@ -139,6 +139,8 @@ describe Shinmun::Blog do
   it &quot;should post a comment&quot; do    
     post &quot;/2008/10/new-post/comments?name=Hans&amp;text=Hallo&quot;
     post &quot;/2008/10/new-post/comments?name=Peter&amp;text=Servus&quot;
+
+    blog.store.load
     
     comments = blog.comments_for(@posts[0])
 </diff>
      <filename>test/blog_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3deb5fffbc705aca3fe9896c97224fd371fb1f5b</id>
    </parent>
  </parents>
  <author>
    <name>Matthias Georgi</name>
    <email>matti.georgi@gmail.com</email>
  </author>
  <url>http://github.com/georgi/shinmun/commit/73a0bf57cf73fecd51caf3c8e3dc4332e46ccd42</url>
  <id>73a0bf57cf73fecd51caf3c8e3dc4332e46ccd42</id>
  <committed-date>2009-05-05T09:00:47-07:00</committed-date>
  <authored-date>2009-05-05T09:00:47-07:00</authored-date>
  <message>fixed some bugs</message>
  <tree>cd217b32dc0f0e814af01154fb2938e3e489e26c</tree>
  <committer>
    <name>Matthias Georgi</name>
    <email>matti.georgi@gmail.com</email>
  </committer>
</commit>
