For deleted nodes created via factories, make sure the most recent old_node is also deleted
This commit is contained in:
parent
17e9bcd2d4
commit
66ae9a48a6
1 changed files with 7 additions and 0 deletions
|
@ -18,6 +18,13 @@ FactoryGirl.define do
|
|||
(1..node.version).each do |n|
|
||||
create(:old_node, :node_id => node.id, :version => n)
|
||||
end
|
||||
|
||||
# For deleted nodes, make sure the most recent old_node is also deleted.
|
||||
if node.visible == false
|
||||
latest = node.old_nodes.find_by(:version => node.version)
|
||||
latest.visible = false
|
||||
latest.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue