Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix editing of Default Container Image Rate #3673

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions app/controllers/chargeback_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ def cb_rate_edit
if @edit[:new][:description].nil? || @edit[:new][:description] == ""
render_flash(_("Description is required"), :error)
return
elsif @rate.description == "Default Container Image Rate" && @edit[:new][:description] != @rate.description
render_flash(_("Can not change description of 'Default Container Image Rate'"), :error)
return
end
@rate.description = @edit[:new][:description]
@rate.rate_type = @edit[:new][:rate_type] if @edit[:new][:rate_type]
Expand Down
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