<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -76,6 +76,7 @@ class Book &lt; ActiveRecord::Base
         taken = self.days_taken
         post.body  = &quot;'#{title}', by #{author} - finished in #{days_taken} days&quot;  
         status = TWITTER.status(:post, &quot;'#{title}', by #{author} - finished in #{days_taken} days&quot;) if configatron.twitter_use
+        ActionController::Base.new.expire_fragment(:controller =&gt; &quot;books&quot;, :action =&gt; &quot;index&quot;)  
     end
     post.save
   end
@@ -111,7 +112,14 @@ class Book &lt; ActiveRecord::Base
   def self.pages_by_month
     items           = []
     processed_items = []
-    finished.each {|book| book.pages_by_month.each {|i| items &lt;&lt; i } }
+    
+    finished.each do |book| 
+      next if book.pages.nil?
+      next if book.started_on.nil?
+      next if book.finished_on.nil?
+      book.pages_by_month.each {|i| items &lt;&lt; i } 
+    end
+    
     items.each do |i|
       target_month = processed_items.find{|o| o[:month] == i[:month]}
       if target_month </diff>
      <filename>app/models/book.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@
 &lt;div id=&quot;container&quot;&gt;
 	&lt;% if @current &amp;&amp; @current.size &gt; 0%&gt;
 		&lt;h1&gt;Current Books&lt;/h1&gt;
-		&lt;table border=&quot;0&quot; id=&quot;current&quot;&gt;  
+		&lt;table border=&quot;0&quot; id=&quot;current&quot;&gt;	 
 			&lt;% for book in @current %&gt;
 				&lt;%= render :partial =&gt; 'current_book', :locals =&gt; { :book =&gt; book } %&gt;
 			&lt;% end %&gt;
@@ -15,10 +15,10 @@
 	&lt;% @current_item = 0 %&gt;
 		&lt;hr&gt;
 		&lt;h1&gt;Next Books&lt;/h1&gt;
-		&lt;table border=&quot;0&quot;&gt;  
+		&lt;table border=&quot;0&quot;&gt;	
 			&lt;tr&gt;
 			&lt;% for book in @next %&gt;
-				&lt;%= render :partial =&gt; 'single_book', :locals =&gt; { :book =&gt; book }  %&gt;
+				&lt;%= render :partial =&gt; 'single_book', :locals =&gt; { :book =&gt; book }	%&gt;
 				&lt;% end %&gt;
 		&lt;/table&gt;
 		&lt;br/&gt;
@@ -26,21 +26,26 @@
 
 	&lt;% if @finished &amp;&amp; @finished.size &gt; 0%&gt;
 	&lt;hr&gt;	
-	&lt;% @current_item = 0 %&gt;	
+	&lt;% @current_item = 0 %&gt; 
 	&lt;h1&gt;Finished Books&lt;/h1&gt;
 	&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpading=&quot;0&quot;&gt;
 		&lt;tr&gt;
 		&lt;% for book in @finished %&gt;
-			&lt;%= render :partial =&gt; 'finished_book', :locals =&gt; { :book =&gt; book }  %&gt;
+			&lt;%= render :partial =&gt; 'finished_book', :locals =&gt; { :book =&gt; book }	%&gt;
 		&lt;% end %&gt;
 	&lt;/table&gt;
 	&lt;% end %&gt;
 
+  &lt;% if @finished &amp;&amp; @finished.size &gt; 0%&gt;	
+    &lt;% cache do %&gt;
+    	&lt;hr&gt;
+    	&lt;h1&gt;Readed pages per month&lt;/h1&gt;
+    	&lt;div id=&quot;graph&quot; &gt;&amp;nbsp;&lt;/div&gt;
+    	&lt;%= pages_graphic(Book.pages_by_month) %&gt;
+    &lt;% end %&gt;
+  &lt;% end %&gt;
+  	
 	&lt;hr&gt;
-  &lt;h1&gt;Readed pages per month&lt;/h1&gt;
-  &lt;div id=&quot;graph&quot; &gt;&amp;nbsp;&lt;/div&gt;
-
-  &lt;hr&gt;
 	&lt;table border=&quot;0&quot; class=&quot;stats&quot;&gt;
 		&lt;tr&gt;
 			&lt;th&gt;Finished Books&lt;/th&gt;
@@ -55,12 +60,10 @@
 &lt;/div&gt;
 
 
-  
+	
 &lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
 	table {width: 600px;}
-	td    {padding: 10px;}
+	td		{padding: 10px;}
 	#graph img {border: 0px; margin-top: 20px;}
 	#graph {text-align: center;}
 &lt;/style&gt;
-
-&lt;%= pages_graphic(Book.pages_by_month) %&gt;
\ No newline at end of file</diff>
      <filename>app/views/books/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -15,6 +15,7 @@ cryptonomicon:
   image: http://upload.wikimedia.org/wikipedia/en/9/93/Cryptonomicon%281stEd%29.jpg
   author: Neal Stephenson
   created_at: 2007-11-17 17:26:40
+  started_on: 2007-11-17 17:26:40
   blurb: Computer expert Randy Waterhouse spearheads a movement to create a safe haven for data in a world where information equals power and big business and government seek to control the flow of knowledge. His ambitions collide with a top-secret conspiracy with links to the encryption wars of World War II and his grandfather's work in preventing the Nazis from discovering that the Allies had cracked their supposedly unbreakable Enigma code. The author of Snow Crash (LJ 4/1/92) focuses his eclectic vision on a story of epic proportions, encompassing both the beginnings of information technology in the 1940s and the blossoming of the present cybertech revolution.
   state: current
   pages: 100</diff>
      <filename>test/fixtures/books.yml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>179d87c314f62c66e39de7376d5c03ad15c8f034</id>
    </parent>
  </parents>
  <author>
    <name>Rodrigo Franco (Caffo)</name>
    <email>caffeine@gmail.com</email>
  </author>
  <url>http://github.com/caffo/bookqueue/commit/8d417fab72f1dfd6ff6344544c91348a5d726844</url>
  <id>8d417fab72f1dfd6ff6344544c91348a5d726844</id>
  <committed-date>2009-10-06T10:31:34-07:00</committed-date>
  <authored-date>2009-10-06T10:31:34-07:00</authored-date>
  <message>Small fixes in the report caching</message>
  <tree>9f81b67e2b72c828dd7f50705be3c622ea0c492f</tree>
  <committer>
    <name>Rodrigo Franco (Caffo)</name>
    <email>caffeine@gmail.com</email>
  </committer>
</commit>
