From: Tom Hughes Date: Tue, 11 Jun 2013 17:26:40 +0000 (+0100) Subject: Use note.closed? in a consistent way X-Git-Tag: live~4970 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/5efe07f164ae62bd758a24c571b8b2f6089ed696?ds=sidebyside Use note.closed? in a consistent way --- diff --git a/app/views/notes/_note.gpx.builder b/app/views/notes/_note.gpx.builder index e6c365394..a55ed88f6 100644 --- a/app/views/notes/_note.gpx.builder +++ b/app/views/notes/_note.gpx.builder @@ -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 diff --git a/app/views/notes/_note.json.jsonify b/app/views/notes/_note.json.jsonify index f8872c717..74ff5ccec 100644 --- a/app/views/notes/_note.json.jsonify +++ b/app/views/notes/_note.json.jsonify @@ -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 diff --git a/app/views/notes/_note.rss.builder b/app/views/notes/_note.rss.builder index a1ed7d378..802f3bc81 100644 --- a/app/views/notes/_note.rss.builder +++ b/app/views/notes/_note.rss.builder @@ -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) diff --git a/app/views/notes/_note.xml.builder b/app/views/notes/_note.xml.builder index 42e69fec2..2b978e325 100644 --- a/app/views/notes/_note.xml.builder +++ b/app/views/notes/_note.xml.builder @@ -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 diff --git a/app/views/notes/mine.html.erb b/app/views/notes/mine.html.erb index fd0e29165..666c7dc8f 100644 --- a/app/views/notes/mine.html.erb +++ b/app/views/notes/mine.html.erb @@ -17,7 +17,7 @@ <% @notes.each do |note| -%> class="creator"<% end %>> - <% if note.status == "closed" %> + <% if note.closed? %> <%= image_tag("closed_note_marker.png", :alt => 'closed') %> <% else %> <%= image_tag("open_note_marker.png", :alt => 'open') %>