<p>In app/controllers/changeset_controller.rb:</p>
<pre style='color:#555'>> @@ -305,6 +312,146 @@ def feed
> list
> end
>
> + ##
> + # Add a comment to a changeset
> + def comment
> + # Check the arguments are sane
> + raise OSM::APIBadUserInput.new("No id was given") unless params[:id]
> + raise OSM::APIBadUserInput.new("No text was given") if params[:text].blank?
> +
> + # Extract the arguments
> + id = params[:id].to_i
> + body = params[:text]
> +
> + # Find the changeset and check it is valid
> + @changeset = Changeset.find(id)
> + raise OSM::APINotFoundError unless @changeset
</pre>
<p>You shouldn't need this - the <code>find</code> call will raise <code>ActiveRecord::RecordNotFound</code> anyway if the id doesn't exist.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/openstreetmap-website/pull/772/files#r15402396">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/1419053__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMTkxNjkzMiwiZGF0YSI6eyJpZCI6MzU4NjU3NjJ9fQ==--dd69c8d9695c5f7d2cb661dcaf6e651b77d949a5.gif" width="1" /></p>