Commit graph

69 commits

Author SHA1 Message Date
Tom Hughes
46cd08b1c8 Replace composite_primary_keys with rails builtin support 2023-10-18 18:26:14 +01:00
Gregory Igelmund
a4edd3fd04
Annotate models 2023-10-14 11:19:13 +08:00
Tom Hughes
cbcc7dc49f Fix some rubocop Naming/PredicateName warnings 2022-03-03 22:47:55 +00:00
Andy Allan
45487e1ff8 Merge branch 'pull/3472' 2022-03-02 15:00:25 +00:00
Andy Allan
8938ab7997 Remove redundant presence validation on belongs_to
There's no need for us to have it when rails does this for us.
2022-03-01 10:01:16 +00:00
Andy Allan
619ac4c5b2 Enable active_record.belongs_to_required_by_default
This switches the logic so that belongs_to parent objects must exist
by default, and marks the optional ones explicitly. This is reflected
in the null/not_null status on the relevant db columns.
2022-02-23 20:33:28 +00:00
Tom Hughes
03fdc6d67f Add inverse_of to relationships that can't detect it automatically 2022-02-23 19:23:51 +00:00
Tom Hughes
fea1b5b88d Fix new rubocop warnings 2021-12-28 19:47:51 +00:00
Andy Allan
baea8dc10e Remove unused to_xml and to_xml_node methods from models 2021-09-15 17:05:50 +01:00
Tom Hughes
2d50a84004 Fix new rubocop warnings 2021-02-16 21:14:54 +00:00
Tom Hughes
0654be27f9 Fix new rubocop warnings 2021-01-11 19:17:31 +00:00
Tom Hughes
0ff89c31e4 Remove both Potlatch versions
Fixes #2622
2021-01-05 21:18:45 +00:00
Tom Hughes
c2af89c00e Fix rubocop Style/SoleNestedConditional warnings 2020-09-02 18:54:55 +01:00
Tom Hughes
0e2a66e8de Fix new rubocop warnings 2020-08-06 18:42:16 +01:00
Andy Allan
a41d500b9f Create an ApplicationRecord for models to inherit from
This is the default for Rails 5+, and also paves the way for
multiple database support.
2019-11-27 11:50:48 +01:00
Andy Allan
4377e2bd55 Update annotations to correctly show bigint types 2019-05-29 11:52:20 +02:00
Andy Allan
b2a8df0bd7 Add annotate gem and associated rake task. Annotate models. 2017-10-22 22:18:26 +01:00
Tom Hughes
f04211b172 Improve test coverage 2015-02-27 00:40:37 +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
5cbd4038ed Fix rubocop style issues 2015-02-20 08:56:16 +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
6e56580278 Remove some (hopefully) redundant code 2015-01-11 12:54:17 +00:00
Tom Hughes
c866d28fd4 Test get_nodes_undelete methods of the OldWay model 2013-12-05 17:49:06 +00:00
Tom Hughes
8c029f8d79 Simplify a number of object model methods 2013-12-05 00:50:04 +00:00
Tom Hughes
9544ab12b8 More refactoring of common code in object models
Tidy up code and extract generation of tag elements to the
common code in the ObjectMetadata module.
2013-12-04 00:29:48 +00:00
Simon Legner
413baecf6b Refactor generation of object metadata in API calls
Factor out duplicate from the object models into common code.
2013-12-04 00:09:52 +00:00
Tom Hughes
b92a2de9ec Use changeset and user caches in Changeset#download 2013-04-01 14:18:21 +01:00
Matt Amos
c8971a545c Removed user checks from to_xml_node, as these should already be
handled at the controller level.
2012-04-05 13:53:48 +01:00
Matt Amos
59280377bf Fixed redaction attribute on old nodes and ways, added same
functionality to relations.
2012-04-05 13:53:44 +01:00
Matt Amos
eca8f6e849 Used unredacted scope rather than explicit SQL 2012-04-05 13:52:04 +01:00
Matt Amos
7c2ca3efb1 Fixed AMF controller methods to hide redacted nodes 2012-04-05 13:50:11 +01:00
Matt Amos
990f3eba40 Altered old_way stuff to be Railsy like old_node is now 2012-04-05 13:49:43 +01:00
Kai Krueger
72e59b49fa Copy the redaction code from nodes to ways 2012-04-05 13:49:39 +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
5a8c4faf3e Replace deprecated methods with modern equivalents 2012-02-15 17:48:17 +00:00
Tom Hughes
5a98d6e4f1 Spell way_id correctly 2011-11-17 11:33:48 +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
8ae5d94b2f Update some more queries to use AREL in place of deprecated methods 2011-11-14 09:42:51 +00:00
Matt Amos
ce667bbbb1 Working around mysql bug... 2009-05-26 16:55:05 +00:00
Richard Fairhurst
dfa81462b8 history stuff should be working now (haha) 2009-02-25 22:04:22 +00:00
Richard Fairhurst
e827a04607 further work on 0.6 history (not quite complete yet) 2009-02-25 01:14:19 +00:00
Shaun McDonald
1375095343 More model validations. Fixing one test. 2008-11-25 17:23:47 +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
Matt Amos
b38b2c2d0f Fixed xml method of old way model. 2008-10-13 14:38:32 +00:00
Shaun McDonald
b91b514cf2 moving the check consistency to it's own file so that checks will be able to be loaded into the way and relation models, without loading the node stuff. 2008-10-13 14:34:04 +00:00
Shaun McDonald
328d47e506 Fixing a bug in my foreign keys. I can now upload and download nodes and ways using JOSM in the new API. 2008-10-03 17:09:58 +00:00
Shaun McDonald
40414cf324 changing the belongs_to and has_many items in the models to reflect the new foriegn keys in the db and the fact that a (old)node/way/relation now belong to a changeset, which in turn has a user. 2008-09-30 18:21:56 +00:00