diff --git a/app/models/task.rb b/app/models/task.rb index 862afaf..6163261 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -73,10 +73,6 @@ class Task < ActiveRecord::Base end end - def self.all_types - %w[Invitation EnterpriseActivation AddMember Ticket SuggestArticle AddFriend CreateCommunity AbuseComplaint ApproveComment ApproveArticle CreateEnterprise ChangePassword EmailActivation InviteFriend InviteMember] - end - # this method finished the task. It calls #perform, which must be overriden # by subclasses. At the end a message (as returned by #finish_message) is # sent to the requestor with #notify_requestor. diff --git a/app/views/tasks/index.html.erb b/app/views/tasks/index.html.erb index 6f82fe4..17d01b8 100644 --- a/app/views/tasks/index.html.erb +++ b/app/views/tasks/index.html.erb @@ -3,9 +3,10 @@

<%= _("%s's pending tasks") % profile.name %>

-<% type_collection = [[nil, _('All')]] %> -<% type_collection += Task.all_types.sort_by {|klass| klass.constantize.new.title}.map{|s| [s, s.constantize.new.title] } %> - +<% + type_collection = [[nil, _('All')]] + type_collection += @tasks.map { |t| [t.name, t.title] }.uniq +%> <% if !@failed.blank? %> -- libgit2 0.21.2