Commit graph

77 commits

Author SHA1 Message Date
Tom Hughes
de29e9b3f5 Fix Style/NumericPredicate rubocop warnings 2018-09-22 17:34:58 +01:00
Tom Hughes
6c2093b29d Fix new rubocop warnings 2018-09-22 17:12:29 +01:00
Andy Allan
b2a8df0bd7 Add annotate gem and associated rake task. Annotate models. 2017-10-22 22:18:26 +01:00
Tom Hughes
8dae890a76 Fix rubocop warnings 2017-10-05 19:18:38 +01:00
Andy Allan
b4be5596f5 Rename xml processing methods with an update_ prefix
They behave differently from the other from_xml methods on other models.
2017-08-30 11:40:54 +01:00
Andy Allan
c647aa3d4d Refactor the from_xml methods to act on existing trace objects.
Setting the new tags with the = operator takes care of removing the
old ones, and is the same approach as taken by the tagstring= method.

Fixes #1600
2017-08-18 10:09:50 +01:00
Tom Hughes
9b89d4eefe Remove conditions from delete_all
Passing conditions directory to delete_all is deprecated
in rails 5.0 so use a separate where instead.
2017-06-02 16:33:48 +01:00
Tom Hughes
5b33f3f8e3 Fix rubocop warnings 2017-06-02 00:08:30 +01:00
Tom Hughes
f435fce007 Link GPX fixture files instead of stubbing 2017-02-05 17:26:31 +00:00
Andy Allan
f464e2a6e9 Suppress XML parsing errors.
This technique was already used in app/models/changeset.rb

This suppresses the error messages when parsing invalid XML, but
the exceptions are still raised, as tested in test_from_xml_double_lat
in test/models/node_test.rb
2016-10-26 10:35:03 +01:00
Tom Hughes
d82f9d12ce Fix new rubocop warnings 2016-09-15 19:21:00 +01:00
Tom Hughes
5d3ecffa28 Fix new rubocop warnings 2016-02-05 13:35:26 +00:00
Tom Hughes
8fe1899596 Fix rubocop warnings 2016-01-19 09:51:24 +00:00
Tom Hughes
fd588cd715 The test train rolls ever onwards... 2015-03-01 17:04:39 +00:00
Tom Hughes
857f0f460b More work on test coverage 2015-02-28 00:45:56 +00:00
Tom Hughes
dbe165bbb3 Fix some rubocop rails style issues 2015-02-26 00:12:54 +00:00
Tom Hughes
a6b84a0294 Fix more rubocop style issues 2015-02-24 23:12:02 +00:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00
Tom Hughes
ef7f3d800c Fix most auto-correctable rubocop issues 2015-02-20 08:56:16 +00:00
Tom Hughes
34e3e51456 Cleanup trailing whitespace 2015-02-20 08:56:16 +00:00
Tom Hughes
28bfb9999f Rename Trace#public to Trace#visible_to_all 2014-07-04 19:24:25 +01:00
Tom Hughes
554a7c9d47 Convert some deprecated methods to modern arel syntax 2013-09-29 22:50:01 +01:00
Tom Hughes
ca30b879f6 Eliminate deprecated scope and association arguments 2013-09-21 11:35:46 +01:00
Tom Hughes
7e896d758d Return GPX traces as application/gpx+xml instead of text/xml 2013-09-09 16:23:38 +01:00
Tom Hughes
b3e540a6b6 Improve tests for trace RSS feeds 2013-05-10 22:48:26 +01:00
Tom MacWright
221ca3c1fa Improve user page navigation menu
Add counts to edits, blocks, and traces; don't show blocks if there
are none; and move OAuth to the settings page.
2012-08-10 08:26:48 +01:00
Tom Hughes
5a8c4faf3e Replace deprecated methods with modern equivalents 2012-02-15 17:48:17 +00:00
Tom Hughes
3227f40193 Make more use of named scopes 2011-11-14 09:42:51 +00:00
Tom Hughes
8ae5d94b2f Update some more queries to use AREL in place of deprecated methods 2011-11-14 09:42:51 +00:00
Tom Hughes
71f1554212 Make trace API a proper CRUD API like other object types 2010-10-11 23:09:27 +01:00
Tom Hughes
9caa2046ca Include description and tags in GPX details API response 2010-10-11 19:10:42 +01:00
Tom Hughes
77ce1b2809 Ignore empty tags. Closes #2311. 2009-09-24 23:27:13 +00:00
Tom Hughes
565171486f Add extra visibility options for GPS traces, and enhance the API call
that returns trace data to return more information if the owner of the
trace has allowed it. Based on a patch from Matt Amos.
2009-08-13 17:06:11 +00:00
Štefan Baebler
9afb533280 added comment for future generations 2009-07-07 22:50:46 +00:00
Štefan Baebler
ebbcf63f0d Introducing comma as tag separator (if present, otherwise it behaves as before), allowing spaces in tags. fixes #2032 2009-07-07 22:05:03 +00:00
Thomas Wood
9bb9de0fbe Require auth on calls to /trace/create, and pass through to form if called without params. Adjust validations on traces to prevent dual error messages on description (validates_presence_of catches the empty string removed from length validation)
More changes to come for api_create
References #1510
2009-01-23 01:19:45 +00:00
Shaun McDonald
a5e5cbc739 Adding a lower and upper length on various web site varchar fields. Fixes one test. 2008-10-15 16:20:43 +00:00
Tom Hughes
6d7e69d4d3 Make the location of the GPX traces configurable. 2008-08-07 11:31:42 +00:00
Tom Hughes
8dbaf76e7c Ignore any files in an __MACOSX folder in a zip file, as these are
metadata files added by the MAC OS X zip tool.
2008-07-31 08:06:09 +00:00
Tom Hughes
fb5f6bb4a2 Rework GPX import daemon to use libxml2 for speed. 2008-07-30 08:37:05 +00:00
Tom Hughes
7d9bf3634c Work around the fact that exists? no longer works for models with
no primary key.
2008-06-07 22:40:39 +00:00
Tom Hughes
112ee9266c Make sure the recorded first point for a trace really is the first
point and not the last. Closes #709.
2008-04-27 12:27:46 +00:00
Tom Hughes
c0d2ad40c3 Work round ruby's half assed Tempfile class which, because for some
reason it is implemented by delegating to File (by inheriting from
DelegateClass(File)) rather than by inheriting from it, does not
actually look like a File, and hence does not look like an IO (in
that it does not respond to kind_of? IO calls).

In ruby 1.8.5 this doesn't matter as REXML checks that the source
it has been given responds to the methods it wants (using respond_to?
which is handled properly by DelegateClass) but in 1.8.4 which we
are running on rails2 REXML uses kind_of? to see if the source is
one it can use.
2008-03-06 12:43:10 +00:00
Tom Hughes
07e8449625 Allow a GPX to be fetched in XML format by fetching data.xml instead
of data (the data method returns it in the format it is stored in).

Closes #534.
2008-01-23 13:40:47 +00:00
Tom Hughes
6595f97c53 Make the name of the lon/lng virtual attribute on trace points consistent. 2007-09-28 23:19:19 +00:00
Tom Hughes
9afb35449b Change the gps_points table to store latitude and longitude values to
seven decimal places to given a worse case precision of about 1cm.
2007-09-18 23:29:47 +00:00
Tom Hughes
4954f65061 Don't bother deleting points which don't exist before importing a
trace - this avoids locking the table in the common case where there
are no points to delete.
2007-09-04 16:22:03 +00:00
Tom Hughes
9861ca8001 Move tag validation to the right place. 2007-08-19 09:16:33 +00:00
Tom Hughes
7dbb746fde Throw an exception if saving the imported trace fails. 2007-08-19 09:11:59 +00:00
Tom Hughes
44051f30d8 Make the gpx/id/data API call work, and make gpx/create a POST method
so arguments can be handled more robustly.
2007-08-16 23:04:18 +00:00