[OSM-dev] API 0.6: new_way
Dave Stubbs
osm.list at randomjunk.co.uk
Sun Nov 9 23:18:37 GMT 2008
On Sun, Nov 9, 2008 at 8:00 PM, Richard Fairhurst <richard at systemed.net> wrote:
> In the way model, what does new_way do?
>
> I'm slightly surprised to encounter
> def delete_with_history!(new_way, user)
>
> when I'd have expected
> def delete_with_history!(changeset)
>
The controller receives a request to /way/<id> with post data being the way XML.
The XML is interpreted to new_way, and contains the changeset ID and
the way version number. The user passed in is the currently authorised
user. delete_with_history then checks for consistency between the
authorised user, the new_way's changeset, and the way version number
before making any change.
new_way is probably a bad var name... I'd have gone with something
like xml_way, input_way, request_way etc.
To replicate without XML you just need to use Way.new to create a Way
object with id, changeset and version all set.
Dave
More information about the dev
mailing list