Commit 6ada9d89 authored by Etienne Baqué's avatar Etienne Baqué

Renamed a method into 'target_type_value'

parent d4f0d945
...@@ -27,15 +27,15 @@ module Audit ...@@ -27,15 +27,15 @@ module Audit
case action.keys.first case action.keys.first
when :add when :add
"Added #{value}#{@details[:as] ? " as #{@details[:as]}" : ''}" "Added #{target_type_value}#{@details[:as] ? " as #{@details[:as]}" : ''}"
when :remove when :remove
"Removed #{value}" "Removed #{target_type_value}"
when :failed_login when :failed_login
"Failed to login with #{Gitlab::Auth::OAuth::Provider.label_for(value).upcase} authentication" "Failed to login with #{Gitlab::Auth::OAuth::Provider.label_for(target_type_value).upcase} authentication"
when :custom_message when :custom_message
value target_type_value
else else
text_for_change(value) text_for_change(target_type_value)
end end
end end
...@@ -48,10 +48,10 @@ module Audit ...@@ -48,10 +48,10 @@ module Audit
changed.join(' ') changed.join(' ')
end end
def value def target_type_value
target_type = @details[:target_type].constantize target_type = @details[:target_type]
val = @details.values.first val = @details.values.first
target_type == Operations::FeatureFlag ? val : val.tr('_', ' ') target_type == 'Operations::FeatureFlag' ? val : val.tr('_', ' ')
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment