Skip to content

Commit

Permalink
[api] fix the database corruption on our life instance, we learned th…
Browse files Browse the repository at this point in the history
…at using "find_all_" is dangerous
  • Loading branch information
adrianschroeter committed Mar 30, 2012
1 parent 94448ae commit 2bd7b24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/db_project.rb
Expand Up @@ -465,7 +465,7 @@ def store_axml( project, force=nil )
# The attribute 'type' is only set for maintenance and maintenance incident projects.
kind_element = project.value(:kind)
# First remove all maintained project relations
DbProject.find_all_by_maintenance_project_id(self.id).each do |maintained_project|
maintained_projects.each do |maintained_project|
maintained_project.maintenance_project_id = nil
maintained_project.save!
end
Expand Down

0 comments on commit 2bd7b24

Please sign in to comment.