2 class Project < ActiveRecord::Base
3 default_scope :conditions => {}
7 class MigrateCustomMergeRequestStatuses < ActiveRecord::Migration
10 Gitorious::Project.all.each do |project|
11 if !project.merge_request_custom_states.blank?
12 project.merge_request_custom_states.each do |open_state|
13 project.merge_request_statuses.create!({
15 :state => MergeRequest::STATUS_OPEN,
16 :color => "#408000" # green-ish
20 project.merge_request_statuses.create!({
22 :state => MergeRequest::STATUS_OPEN,
27 ["Merged", "Rejected"].each do |closed_state|
28 project.merge_request_statuses.create!({
29 :name => closed_state,
30 :state => MergeRequest::STATUS_CLOSED,
31 :color => "#AA0000" # red-ish
40 Gitorious::Project.all.each do |project|
41 project.merge_request_statuses.each do |state|
42 next unless state.open?
43 project.merge_request_custom_states << state.name
44 project.merge_request_custom_states.uniq!