diff --git a/app/models/project.rb b/app/models/project.rb index aad320b..44879ee 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -125,6 +125,10 @@ class Project < ActiveRecord::Base end end + def inherited_categories + self_and_ancestors.inject([]) { |l, p| l += p.issue_categories } + end + def identifier=(identifier) super unless identifier_frozen? end diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index c65735a..d5ae9fe 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -16,8 +16,8 @@
<%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true %>
<% end %> -<% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %> -<%= f.select :category_id, (@issue.project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> +<% if @issue.safe_attribute?('category_id') && @issue.project.inherited_categories.any? %> +
<%= f.select :category_id, (@issue.project.inherited_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> <%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'), l(:label_issue_category_new), 'issue_category[name]',