Commit e4cf99db4615f406dfc60bfc8bca473581b4f910
1 parent
53a3be03
Exists in
master
and in
4 other branches
Refactor milestones related functionality. Added seeds for Milestine and MR
Showing
7 changed files
with
39 additions
and
10 deletions
Show diff stats
app/models/issue.rb
app/models/merge_request.rb
app/roles/issue_commonality.rb
app/views/merge_requests/_merge_request.html.haml
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | - if merge_request.milestone_id? |
14 | 14 | %span.btn.small.disabled.grouped |
15 | 15 | %i.icon-time |
16 | - = merge_request.project.milestones.find(merge_request.milestone_id).title | |
16 | + = merge_request.milestone.title | |
17 | 17 | %span.btn.small.disabled.grouped |
18 | 18 | = merge_request.source_branch |
19 | 19 | → | ... | ... |
app/views/milestones/_milestone.html.haml
... | ... | @@ -13,9 +13,9 @@ |
13 | 13 | .bar{style: "width: #{milestone.percent_complete}%;"} |
14 | 14 | .span6 |
15 | 15 | - if milestone.issues.any? |
16 | - = link_to project_issues_path(milestone.project, milestone_id: milestone.id), class: "btn very_small" do | |
17 | - %strong= pluralize milestone.issues.count, 'Issue' | |
18 | - | |
16 | + = link_to project_issues_path(milestone.project, milestone_id: milestone.id) do | |
17 | + = pluralize milestone.issues.count, 'Issue' | |
18 | + | |
19 | 19 | - if milestone.merge_requests.any? |
20 | - = link_to project_merge_requests_path(milestone.project, milestone_id: milestone.id), class: "btn very_small" do | |
21 | - %strong= pluralize milestone.merge_requests.count, 'Merge Request' | |
20 | + = link_to project_merge_requests_path(milestone.project, milestone_id: milestone.id) do | |
21 | + = pluralize milestone.merge_requests.count, 'Merge Request' | ... | ... |
... | ... | @@ -0,0 +1,13 @@ |
1 | +Milestone.seed(:id, [ | |
2 | + { :id => 1, :project_id => 1, :title => 'v' + Faker::Address.zip_code }, | |
3 | + { :id => 2, :project_id => 1, :title => 'v' + Faker::Address.zip_code }, | |
4 | + { :id => 3, :project_id => 1, :title => 'v' + Faker::Address.zip_code }, | |
5 | + { :id => 4, :project_id => 2, :title => 'v' + Faker::Address.zip_code }, | |
6 | + { :id => 5, :project_id => 2, :title => 'v' + Faker::Address.zip_code }, | |
7 | + | |
8 | + { :id => 6, :project_id => 2, :title => 'v' + Faker::Address.zip_code }, | |
9 | + { :id => 7, :project_id => 2, :title => 'v' + Faker::Address.zip_code }, | |
10 | + { :id => 8, :project_id => 3, :title => 'v' + Faker::Address.zip_code }, | |
11 | + { :id => 9, :project_id => 3, :title => 'v' + Faker::Address.zip_code }, | |
12 | + { :id => 11, :project_id => 3, :title => 'v' + Faker::Address.zip_code }, | |
13 | +]) | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +MergeRequest.seed(:id, [ | |
2 | + { :id => 1, milestone_id: 1, project_id: 1, source_branch: 'master', target_branch: 'feature', author_id: 1, assignee_id: 1, title: Faker::Lorem.sentence(6) }, | |
3 | + { :id => 2, milestone_id: 1, project_id: 1, source_branch: 'master', target_branch: 'feature', author_id: 2, assignee_id: 2, title: Faker::Lorem.sentence(6) }, | |
4 | + { :id => 3, milestone_id: 1, project_id: 1, source_branch: 'master', target_branch: 'feature', author_id: 3, assignee_id: 3, title: Faker::Lorem.sentence(6) }, | |
5 | + { :id => 4, milestone_id: 1, project_id: 1, source_branch: 'master', target_branch: 'feature', author_id: 4, assignee_id: 4, title: Faker::Lorem.sentence(6) }, | |
6 | + { :id => 5, milestone_id: 1, project_id: 1, source_branch: 'master', target_branch: 'feature', author_id: 5, assignee_id: 5, title: Faker::Lorem.sentence(6) }, | |
7 | + | |
8 | + { :id => 6, milestone_id: 5, project_id: 2, source_branch: 'master', target_branch: 'feature', author_id: 1, assignee_id: 1, title: Faker::Lorem.sentence(6) }, | |
9 | + { :id => 7, milestone_id: 6, project_id: 2, source_branch: 'master', target_branch: 'feature', author_id: 2, assignee_id: 2, title: Faker::Lorem.sentence(6) }, | |
10 | + { :id => 8, milestone_id: 6, project_id: 2, source_branch: 'master', target_branch: 'feature', author_id: 3, assignee_id: 3, title: Faker::Lorem.sentence(6) }, | |
11 | + { :id => 9, milestone_id: 6, project_id: 2, source_branch: 'master', target_branch: 'feature', author_id: 4, assignee_id: 4, title: Faker::Lorem.sentence(6) }, | |
12 | + { :id => 11, milestone_id: 5, project_id: 2, source_branch: 'master', target_branch: 'feature', author_id: 5, assignee_id: 5, title: Faker::Lorem.sentence(6) }, | |
13 | + | |
14 | + { :id => 12, milestone_id: 9, project_id: 3, source_branch: 'master', target_branch: 'feature', author_id: 1, assignee_id: 1, title: Faker::Lorem.sentence(6)}, | |
15 | + { :id => 13, milestone_id: 9, project_id: 3, source_branch: 'master', target_branch: 'feature', author_id: 2, assignee_id: 2, title: Faker::Lorem.sentence(6)}, | |
16 | + { :id => 14, milestone_id: 9, project_id: 3, source_branch: 'master', target_branch: 'feature', author_id: 3, assignee_id: 3, title: Faker::Lorem.sentence(6)}, | |
17 | + { :id => 15, milestone_id: 9, project_id: 3, source_branch: 'master', target_branch: 'feature', author_id: 4, assignee_id: 4, title: Faker::Lorem.sentence(6)}, | |
18 | + { :id => 16, milestone_id: 9, project_id: 3, source_branch: 'master', target_branch: 'feature', author_id: 5, assignee_id: 5, title: Faker::Lorem.sentence(6)}, | |
19 | +]) | ... | ... |