Use note.closed? in a consistent way
authorTom Hughes <tom@compton.nu>
Tue, 11 Jun 2013 17:26:40 +0000 (18:26 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 11 Jun 2013 17:26:54 +0000 (18:26 +0100)
app/views/notes/_note.gpx.builder
app/views/notes/_note.json.jsonify
app/views/notes/_note.rss.builder
app/views/notes/_note.xml.builder
app/views/notes/mine.html.erb

index e6c3653941965041c022d5e63f1bb28b2d2d5ac5..a55ed88f6f5d767aed605e5077e57ec0909f19c2 100644 (file)
@@ -17,7 +17,7 @@ xml.wpt("lon" => note.lon, "lat" => note.lat) do
     xml.date_created note.created_at
     xml.status note.status
 
-    if note.status == "closed"
+    if note.closed?
       xml.date_closed note.closed_at
     end
   end
index f8872c717c184c9da9aab84e79150dd1075d242f..74ff5ccec621da2a1d38ba0ba129ce30b4c7f43a 100644 (file)
@@ -18,7 +18,7 @@ json.properties do
 
   json.date_created note.created_at
   json.status note.status
-  json.closed_at note.closed_at if note.status == "closed"
+  json.closed_at note.closed_at if note.closed?
 
   json.comments(note.comments) do |comment|
     json.date comment.created_at
index a1ed7d3784ed4a1e9b2394c79f60ccf4b58ad59e..802f3bc81b6b721aef82f81e67ab122cbe386502 100644 (file)
@@ -1,7 +1,7 @@
 xml.item do
   location = describe_location(note.lat, note.lon, 14, locale)
 
-  if note.status == "closed"
+  if note.closed?
     xml.title t('note.rss.closed', :place => location)
   elsif note.comments.length > 1
     xml.title t('note.rss.comment', :place => location)
index 42e69fec2a7def80f70aa3a47d98b274a0d33ee1..2b978e325f116b4d8effbccaf772fa689f268ed7 100644 (file)
@@ -12,7 +12,7 @@ xml.note("lon" => note.lon, "lat" => note.lat) do
   xml.date_created note.created_at
   xml.status note.status
 
-  if note.status == "closed"
+  if note.closed?
     xml.date_closed note.closed_at
   end
 
index fd0e2916562369a73cfd4c9915115b063be3b675..666c7dc8f94c6af01bad70d4f32d2b54969949f6 100644 (file)
@@ -17,7 +17,7 @@
 <% @notes.each do |note| -%>
   <tr<% if note.author != @user2 %> class="creator"<% end %>>
     <td>
-      <% if note.status == "closed" %>
+      <% if note.closed? %>
         <%= image_tag("closed_note_marker.png", :alt => 'closed') %>
       <% else %>
         <%= image_tag("open_note_marker.png", :alt => 'open') %>