Commit graph

17 commits

Author SHA1 Message Date
Tom Hughes
a3a228862c Add validation for relation member roles
Fixes #3563
2022-06-09 19:21:08 +01:00
Tom Hughes
39b60219fe Fix new rubocop warnings 2020-06-11 19:21:41 +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
c72940684e Fix error resolving relation parents
It's not entirely clear why specifying the foreign key explicitly
fixes this - the value given is what it should default to - but
without this it finds the child relation instead when looking at
the parents of a relation.

Fixes #789
2014-07-24 00:23:45 +01:00
Tom Hughes
5a8c4faf3e Replace deprecated methods with modern equivalents 2012-02-15 17:48:17 +00:00
Tom Hughes
9930b03388 Remove remnants of old lower case relation member types 2012-02-15 17:48:16 +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
0dba53c023 Declare callbacks explicitly 2011-11-14 09:42:43 +00:00
Tom Hughes
5b0e72ec71 Get rid of foreign_class specification which is no longer needed. 2009-05-01 23:20:53 +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
Shaun McDonald
995c9df195 more diary entry tests, and a minor fix to the relation member that makes the code a bit more readable. 2008-11-11 18:07:59 +00:00
Andy Allan
9f64b0848f nil protection - mysql however has a default for enums, which is why it wasn't a problem before 2008-11-10 17:10:55 +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
Tom Hughes
b527d27674 Use a polymorphic association to model relation members and add
associations for upward links from objects to relations that they
are a part of.
2008-06-21 17:38:17 +00:00
Frederik Ramm
78b440ffc1 preliminary commit 0.5 API with relations / untested after entity-relation rename, some changes still in queue 2007-08-29 22:00:26 +00:00