summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-10-18 19:31:10 +0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:28 -0200
commit891e5f4851c2067daba12a1750651170a1583481 (patch)
tree956c8fdc9e9e6f269283ee615c580d4fc0ceb666 /app/models
parent2f7260b460f2a893241039115a201c2522fb47ca (diff)
downloadgitlab-ce-891e5f4851c2067daba12a1750651170a1583481.tar.gz
Update specs to cope with new label types and priorities
Fixed all related specs and also changed the logic to handle edge cases. This includes exporting and exporting of group labels, which will get associated with the new group (if any) or they will become normal project labels otherwise. Found other issues to do with not being able to import all labels at once in the beginning of the JSON - code was much simpler when we import all labels and milestones associated to a project first, then the associations will find the already created labels instead of creating them from the associations themselves.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index bc15ca3fc2e..94105a8ea79 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -738,6 +738,10 @@ class Project < ActiveRecord::Base
end
end
+ def all_labels
+ Label.find_by_project_id(self.id)
+ end
+
def find_service(list, name)
list.find { |service| service.to_param == name }
end