]> git.openstreetmap.org Git - rails.git/blob - test/factories/changesets.rb
Merge remote-tracking branch 'upstream/pull/5926'
[rails.git] / test / factories / changesets.rb
1 FactoryBot.define do
2   factory :changeset do
3     transient do
4       bbox { nil }
5     end
6
7     created_at { Time.now.utc }
8     closed_at { Time.now.utc + 1.day }
9     min_lon { (bbox[0] * GeoRecord::SCALE).round if bbox }
10     min_lat { (bbox[1] * GeoRecord::SCALE).round if bbox }
11     max_lon { (bbox[2] * GeoRecord::SCALE).round if bbox }
12     max_lat { (bbox[3] * GeoRecord::SCALE).round if bbox }
13
14     user
15
16     trait :closed do
17       created_at { Time.now.utc - 5.hours }
18       closed_at { Time.now.utc - 4.hours }
19     end
20   end
21 end