<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -34,7 +34,7 @@ class CommentsController &lt; ApplicationController
     unless params[:parent_id].blank?
       @parent_comment = Comment.find(params[:parent_id])
       %w{ commentable_id commentable_type commentable_private }.each do |attr|
-        params[attr.to_sym] = @parent_comment.send(attr.to_sym)
+        params[attr.to_sym] = @parent_comment.send(attr.to_sym).to_s
       end
       @comment.title ||= &quot;Re: #{@parent_comment.title.gsub(/^Re:\s?/i, '')}&quot;
       @comment.tag_list = @parent_comment.raw_tag_list</diff>
      <filename>app/controllers/comments_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,4 +23,12 @@ module CommentsHelper
     wrapped_lines_array.collect! { |wrapped_line| &quot;&amp;gt; #{wrapped_line}&quot; }
     wrapped_lines_array.join('&lt;br /&gt;')
   end
+
+  # We need to handle new comments, when the form has
+  # been submitted, and when editing a comment.
+  def comment_private?(comment)
+    (params[:commentable_private] &amp;&amp; params[:commentable_private].to_bool) ||
+    (params[:comment] &amp;&amp; params[:comment][:commentable_private] &amp;&amp; params[:comment][:commentable_private].to_bool) ||
+    (comment.private?)
+  end
 end</diff>
      <filename>app/helpers/comments_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,8 +15,7 @@
                         &lt;%= hidden_field_tag &quot;relate_to_topic&quot;, params[:relate_to_topic] %&gt;
                 &lt;% end %&gt;
 
-                &lt;% commentable_private = params[:commentable_private] || (params[:comment] &amp;&amp; params[:comment][:commentable_private]) || (@comment.private? ? '1' : '0') %&gt;
-                &lt;%= hidden_field_tag 'comment[commentable_private]', commentable_private %&gt;
+                &lt;%= hidden_field_tag 'comment[commentable_private]', (comment_private?(@comment) ? '1' : '0') %&gt;
 
                 &lt;div class=&quot;form-element&quot;&gt;
                   &lt;label for=&quot;comment_title&quot;&gt;&lt;%=t 'comments.form.title' %&gt;&lt;/label&gt;
@@ -74,7 +73,7 @@
                 &lt;% end %&gt;
 
                 &lt;% if show_notification_controls?(@current_basket) %&gt;
-                  &lt;div id=&quot;skip_email_notification_div&quot;&lt;%= &quot;style='display:none;'&quot; unless commentable_private %&gt;&gt;
+                  &lt;div id=&quot;skip_email_notification_div&quot;&lt;%= &quot;style='display:none;'&quot; unless comment_private?(@comment) %&gt;&gt;
                     &lt;div class=&quot;form-element&quot;&gt;
                       &lt;label for=&quot;comment_skip_email_notification&quot;&gt;
                         &lt;%=t 'comments.form.skip_email_notification',</diff>
      <filename>app/views/comments/_form.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -36,10 +36,10 @@ class String
     URI.decode(self)
   end
 
-  # converts &quot;true&quot;, &quot;false&quot;, and &quot;nil&quot; into their appropriate boolean/NilClass values
+  # converts &quot;true&quot;, &quot;1&quot;, &quot;false&quot;, &quot;0&quot; and &quot;nil&quot; into their appropriate boolean/NilClass values
   def to_bool
-    return true if self == &quot;true&quot;
-    return false if self == &quot;false&quot;
+    return true if self == &quot;true&quot; || self == &quot;1&quot;
+    return false if self == &quot;false&quot; || self == &quot;0&quot;
     return nil if self == &quot;nil&quot;
     return self
   end</diff>
      <filename>config/initializers/all_extensions.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>32b0e9d9a39eb76689e1f6e72d55aa576aec6813</id>
    </parent>
  </parents>
  <author>
    <name>Kieran Pilkington</name>
    <email>kieran@katipo.co.nz</email>
  </author>
  <url>http://github.com/kete/kete/commit/4f7ba2e8abffdddfb6aee1297bf114bb23a5d023</url>
  <id>4f7ba2e8abffdddfb6aee1297bf114bb23a5d023</id>
  <committed-date>2009-11-08T14:24:02-08:00</committed-date>
  <authored-date>2009-11-08T14:24:02-08:00</authored-date>
  <message>refinement: Supporting more cases of 1 (true) and 0 (false), and extracing view logic into comment helper.</message>
  <tree>4072084131595d0f6cafcaf4bf512793ecff9f3b</tree>
  <committer>
    <name>Kieran Pilkington</name>
    <email>kieran@katipo.co.nz</email>
  </committer>
</commit>
