- changeset = Changeset.find(params[:id])
-
- unless @user.id == changeset.user_id
- raise OSM::APIUserChangesetMismatchError
- end
-
- changeset.open = false
+ changeset = Changeset.find(params[:id])
+ check_changeset_consistency(changeset, @user)
+
+ # to close the changeset, we'll just set its closed_at time to
+ # now. this might not be enough if there are concurrency issues,
+ # but we'll have to wait and see.
+ changeset.set_closed_time_now
+