Skip to content

Commit

Permalink
[api] give the deleted repo another shot
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Dec 3, 2013
1 parent 2980d98 commit 6f910b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/db/migrate/20131022114302_check_deleted_repo.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
class CheckDeletedRepo < ActiveRecord::Migration

class Repository < ActiveRecord::Base; end
class Project < ActiveRecord::Base; end

def self.up
# default repository to link when original one got removed
d = Project.find_or_create_by_name("deleted")
d = Project.where(name: 'deleted').first_or_create
Repository.where(project_id: d.id, name: 'deleted').first_or_create
end

Expand Down

0 comments on commit 6f910b3

Please sign in to comment.