Skip to content

Commit

Permalink
[webui] Get rid of hardcoded string to class mapping
Browse files Browse the repository at this point in the history
Before this change we were enforced to maintain this list manually.
Now, we longer need to take care of this.
  • Loading branch information
Manuel Schnitzer committed Dec 4, 2017
1 parent 0d63239 commit 38faed0
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/api/app/models/bs_request_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,7 @@ def self.get_package_diff(path, query)
end

def self.type_to_class_name(type_name)
case type_name
when :submit then
BsRequestActionSubmit
when :delete then
BsRequestActionDelete
when :change_devel then
BsRequestActionChangeDevel
when :add_role then
BsRequestActionAddRole
when :set_bugowner then
BsRequestActionSetBugowner
when :maintenance_incident then
BsRequestActionMaintenanceIncident
when :maintenance_release then
BsRequestActionMaintenanceRelease
when :group then
BsRequestActionGroup
end
"bs_request_action_#{type_name}".classify.constantize
end

def self.find_sti_class(type_name)
Expand Down

0 comments on commit 38faed0

Please sign in to comment.