Skip to content

Commit

Permalink
Merge pull request #4180 from mschnitzer/refactor_type_to_class_handl…
Browse files Browse the repository at this point in the history
…ing_in_bs_request_model

[webui] Get rid of hardcoded string to class mapping
  • Loading branch information
David Kang committed Dec 4, 2017
2 parents 0d63239 + 38faed0 commit 633971a
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 633971a

Please sign in to comment.