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.

This commit is contained in:
Matt Amos 2008-11-17 19:00:01 +00:00
parent 9a4ea6bfd0
commit a90be5e69a
8 changed files with 166 additions and 20 deletions

View file

@ -7,33 +7,37 @@ normal_user_first_change:
id: 1
user_id: 1
created_at: "2007-01-01 00:00:00"
open: true
closed_at: <%= DateTime.now + Rational(1,24) %>
min_lon: <%= 1 * SCALE %>
min_lat: <%= 1 * SCALE %>
max_lon: <%= 5 * SCALE %>
max_lat: <%= 5 * SCALE %>
num_changes: 11
second_user_first_change:
id: 2
user_id: 2
created_at: "2008-05-01 01:23:45"
open: true
closed_at: <%= DateTime.now + Rational(1,24) %>
num_changes: 0
normal_user_closed_change:
id: 3
user_id: 1
created_at: "2007-01-01 00:00:00"
open: false
closed_at: "2007-01-02 00:00:00"
num_changes: 0
normal_user_version_change:
id: 4
user_id: 1
created_at: "2008-01-01 00:00:00"
open: true
closed_at: <%= DateTime.now + Rational(1,24) %>
min_lon: <%= 1 * SCALE %>
min_lat: <%= 1 * SCALE %>
max_lon: <%= 4 * SCALE %>
max_lat: <%= 4 * SCALE %>
num_changes: 8
# changeset to contain all the invalid stuff that is in the
# fixtures (nodes outside the world, etc...), but needs to have
@ -42,5 +46,5 @@ invalid_changeset:
id: 5
user_id: 3
created_at: "2008-01-01 00:00:00"
open: false
closed_at: "2008-01-02 00:00:00"
num_changes: 9