X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6910434fe0f3c662c0a6e491613fe9171ec627da..d02ea8a1332fc7c32749ab479d68d44e2e76cdfa:/app/controllers/changeset_controller.rb diff --git a/app/controllers/changeset_controller.rb b/app/controllers/changeset_controller.rb index 31004e8ee..733c20922 100644 --- a/app/controllers/changeset_controller.rb +++ b/app/controllers/changeset_controller.rb @@ -162,7 +162,7 @@ class ChangesetController < ApplicationController # global (SVN-style) versioning were used - then that would be # unambiguous. elements.sort! do |a, b| - if (a.timestamp == b.timestamp) + if a.timestamp == b.timestamp a.version <=> b.version else a.timestamp <=> b.timestamp @@ -182,7 +182,7 @@ class ChangesetController < ApplicationController # check these assertions. elements.each do |elt| result.root << - if (elt.version == 1) + if elt.version == 1 # first version, so it must be newly-created. created = XML::Node.new "create" created << elt.to_xml_node(changeset_cache, user_display_name_cache) @@ -294,7 +294,7 @@ class ChangesetController < ApplicationController changesets = changesets.where("changesets.id <= ?", params[:max_id]) end - @edits = changesets.order("changesets.id DESC").limit(20).preload(:user, :changeset_tags) + @edits = changesets.order("changesets.id DESC").limit(20).preload(:user, :changeset_tags, :comments) render :action => :list, :layout => false end @@ -327,7 +327,7 @@ class ChangesetController < ApplicationController :author => @user) # Notify current subscribers of the new comment - changeset.subscribers.each do |user| + changeset.subscribers.visible.each do |user| if @user != user Notifier.changeset_comment_notification(comment, user).deliver_now end @@ -456,7 +456,7 @@ class ChangesetController < ApplicationController # restrict changesets to those enclosed by a bounding box # we need to return both the changesets and the bounding box def conditions_bbox(changesets, bbox) - if bbox + if bbox bbox.check_boundaries bbox = bbox.to_scaled return changesets.where("min_lon < ? and max_lon > ? and min_lat < ? and max_lat > ?",