13 trait :with_history do
14 after(:create) do |way, _evaluator|
15 (1..way.version).each do |n|
16 create(:old_way, :way_id => way.id, :version => n, :changeset => way.changeset)
19 # For deleted ways, make sure the most recent old_way is also deleted.
20 if way.visible == false
21 latest = way.old_ways.find_by(:version => way.version)
22 latest.visible = false
28 factory :way_with_nodes do
33 after(:create) do |way, evaluator|
34 (1..evaluator.nodes_count).each do |n|
35 create(:way_node, :way => way, :sequence_id => n)