Skip to content

Commit

Permalink
Refactor disabled? method for chargeback rate remove button
Browse files Browse the repository at this point in the history
Fixing https://bugzilla.redhat.com/show_bug.cgi?id=1552260

Refactor the method according to the changes in core repo.
  • Loading branch information
Hilda Stastna committed Mar 22, 2018
1 parent 61026e3 commit 172c0b9
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ class ApplicationHelper::Button::ChargebackRateRemove < ApplicationHelper::Butto
needs :@record

def disabled?
@error_message = _('Default Chargeback Rate cannot be removed.') if default?
@error_message = _('Default Chargeback Rate cannot be removed.') if @record.default?
@error_message.present?
end

private

def default?
@record.default? || @record.description == 'Default Container Image Rate'
end
end

0 comments on commit 172c0b9

Please sign in to comment.