Commit graph

100 commits

Author SHA1 Message Date
Tom Hughes
e341ef5673 Remove never actually used code from five years ago 2013-10-11 20:03:06 +01:00
Tom Hughes
ca30b879f6 Eliminate deprecated scope and association arguments 2013-09-21 11:35:46 +01:00
Tom Hughes
f03c8637f7 Extract common code for parsing floats 2013-06-24 22:44:17 +01:00
Ian Dees
9d2fed811f Guard against non-numeric lat and lons in nodes and notes 2013-06-24 22:34:09 +01:00
Andy Allan
2c67c079ac Don't show coordinates for deleted nodes 2012-07-11 14:42:01 +01:00
Matt Amos
67dd9e4c9d Adding first cut of Redactions support
Redactions support hiding historical versions of elements and
collecting meta-data about that action together.
2012-04-05 13:46:36 +01:00
Tom Hughes
92feab9112 Make sure we don't inherit old tags when parsing XML for objects 2012-02-15 17:48:17 +00:00
Tom Hughes
5a8c4faf3e Replace deprecated methods with modern equivalents 2012-02-15 17:48:17 +00:00
Peter Gray
95d899786a Refactor bounding box code
Moved duplicated code into the BoundingBox class, and pass around
BoundingBox objects instead of lists of bounds.
2011-11-14 09:42:57 +00:00
Tom Hughes
fc25c3d412 Rename all ID columns that aren't unique
Having a table with a column called ID that is only part of the
primary key really doesn't work as rails likes to treat ID as a
special name so it becomes impossible to assign to it or read it.
2011-11-14 09:42:52 +00:00
Tom Hughes
1da4cecaf6 List all objects that are blocking a delete, in a well defined order 2011-11-14 09:42:49 +00:00
Tom Hughes
3d55db46ed Avoid use of deprecated methods on error objects 2011-11-14 09:42:45 +00:00
Tom Hughes
226c41be69 Update ActiveRecord queries to use arel 2011-11-14 09:42:44 +00:00
Tom Hughes
15ab888d0c Make sure asking a node for it's history returns an ordered list 2011-09-14 10:16:44 +01:00
Tom Hughes
a9ff3bfc4b Remove tags from deleted nodes
When ways or relations are deleted we remove their tags and there
is no reason why nodes should be different.
2011-05-05 20:25:58 +01:00
Tom Hughes
f07819d81a Rework application configuration
Use a preinitializer to load the settings from application.yml so
that they are available as early as possible. All settings can also
be overridden using environment variables.

The ad-hoc settins in environment.rb are then moved to this new
system so we have one consistent location for settings.
2010-08-04 22:06:05 +01:00
Matt Amos
bb84a78a09 Made XML parsing routines raise an exception if the document is valid XML, but not valid as an OSM document. This is now the same behaviour as when the document isn't valid XML. 2009-08-06 17:28:49 +00:00
Shaun McDonald
65eb6af303 Give a nice error message when parsing the nwr tags and they are missing the k and/or v. Also includes tests. 2009-06-11 11:08:37 +00:00
Shaun McDonald
e4d7b3ee66 Throw errors in the way xml parsing if there is a problem. Bring the way parsing in line with the node parsing. Properly deal with the 0 id case. Some Way.from_xml tests. 2009-06-10 15:42:12 +00:00
Shaun McDonald
e3693d487a More unit tests for the parsing of the Node.from_xml. Some code clean up to ensure that a node that cannot be parsed will always throw an exception, to be handled by the arround handler. 2009-06-08 18:53:19 +00:00
Matt Amos
4ab495f5db Added locking around update and delete methods on main API objects. This should remove the 500 errors which come from concurrent overlapping updates. Experimental - might be too slow for production. 2009-05-21 14:57:03 +00:00
Matt Amos
3d0ca940d2 Using an around_handler for catching and rendering errors in most of the API controller methods. This simplifies the code and makes errors and error messages a bit more consistent. Also added a utility method for checking the HTTP method. 2009-05-20 17:39:59 +00:00
Matt Amos
b7f306a437 Fixed problem where tag lengths were generating a 422 error with no message. They now generate a 400 error with a meaningful message. 2009-05-10 00:33:55 +00:00
Thomas Wood
1d48f48827 Fix another mis-referenced error message id! 2009-05-02 18:28:39 +00:00
Tom Hughes
329b6faf91 Use association names with :joins instead of writing the SQL for the
join by hand.
2009-04-30 23:45:55 +00:00
Shaun McDonald
33d32bf737 We don't need an extra method for the amf controller for saving nodes, just catch the exception and do nothing with that exception. 2009-04-30 15:16:15 +00:00
Thomas Wood
2861236f60 Fix another error reporting bug similar to previous, again on printing RelationMember.id rather than RelationMember.relation.id 2009-04-30 07:10:57 +00:00
Richard Fairhurst
41f85fb77d Potlatch 0.11a 2009-04-30 01:23:50 +00:00
Matt Amos
3e9b6845d3 Fixed 'raw' raises by converting them to the appropriate OSM::APIError type. Made the error messages for placeholder fixing more informative. Added tests for these. 2009-04-29 10:07:35 +00:00
Tom Hughes
bf31791f65 Add a changeset cache to stop us looking up the same changeset over
and over again when processing a map call.
2009-04-28 13:40:30 +00:00
Shaun McDonald
0b6d9ce877 Improve the node/way/relation already deleted error message, and get rid bug in way model with missing new in exception 2009-04-27 11:49:56 +00:00
Matt Amos
82a54db3d9 Fixed dumb copy-and-paste mistake. 2009-04-24 18:47:41 +00:00
Matt Amos
9ff7ea8d71 Added better error messages on 412 precondition failed. 2009-04-23 18:39:36 +00:00
Shaun McDonald
08bd1688ee Railsify the relation member model, type attribute, by putting it into class case, rather than lower case. Requires reload of postgres databases or manual change to the enum. Fixes the databrowser on postgres, however affects the rest of the codebase. 2009-04-15 14:49:21 +00:00
Thomas Wood
6442208841 Add exceptions for remaing cases where XML::Parser.string is used, to catch for empty strings.
See also r14241
2009-04-09 22:37:43 +00:00
Matt Amos
18633b7c9e Fixed a problem where rails was setting the ID column to null, which violates the not-null constraint. Also fixed possible typo in AMF controller. 2009-03-29 02:14:40 +00:00
Matt Amos
afcb345014 Moved a bunch of time functions into UTC. Fixes bugs which we only see for 4 hours a year. 2009-03-29 01:31:04 +00:00
Matt Amos
be75a1504f Fixed a couple of bugs with changeset bounding box calculation when modifying or deleting. 2009-03-27 12:22:23 +00:00
Tom Hughes
c8ee135104 Merge 12304:14009 from trunk. 2009-03-08 13:02:37 +00:00
Tom Hughes
07c1cd6b98 Update to use libxml 1.0.0 gem. 2009-03-08 11:34:46 +00:00
Shaun McDonald
b7335940e2 Some improvements for the XML parsing, as there are somethings that we don't need, like timestamp and visibility, thus hopefully bringing a speedup in the xml parsing. Some more AMF controller fixes, plenty more to go though. 2008-12-09 18:44:11 +00:00
Shaun McDonald
c0b4c1b905 Adding some amf create poi tests. Minor bugfix tweaks to the amf controller 2008-12-08 14:22:34 +00:00
Shaun McDonald
e9527b363d Refactoring the amf controller, and all models so that save_with_history! is now private. Everyone should use create_with_history, delete_with_history, and update_from instead. Also gets the amf controller to do version checks in the node/way/relation models. Needs checked. This breaks Potlatch until #1376 is fixed. 2008-12-04 17:30:17 +00:00
Shaun McDonald
e989b1a880 ensure that uploads that don't supply a lat and lon for a node. Adding related test and fixing other tests. 2008-12-01 18:32:54 +00:00
Shaun McDonald
6e98e324e5 better handling of duplicate tags. Extra validation in the tests. 2008-11-28 17:38:23 +00:00
Matt Amos
299b671522 Moved transaction boundary to cover used-by tests on deletion so that the database can help prevent race conditions. 2008-11-26 14:49:56 +00:00
Shaun McDonald
1375095343 More model validations. Fixing one test. 2008-11-25 17:23:47 +00:00
Matt Amos
a90be5e69a Migration to add close-time to changesets. This replaces the boolean 'open' attribute. Added checks to ensure that the maximum lifetime and number of changes in a changeset are enforced. Added some tests. 2008-11-17 19:00:01 +00:00
Matt Amos
e79fd07638 Made relations ordered. Added some tests for this. Otherwise interface is unchanged. 2008-11-10 15:41:05 +00:00
Dave Stubbs
322d293007 update nodes/ways/relation XML to include user id as well as display name 2008-11-09 16:43:09 +00:00