Skip to content

Commit

Permalink
Corrected invoice payment issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tsoganov committed Jun 14, 2024
1 parent 50b1fde commit f9f9d44
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ plugins:
enabled: false
rubocop:
enabled: true
channel: "rubocop-1-50-2"
channel: rubocop-1-50-2
checks:
method-lines:
config:
Expand Down
2 changes: 1 addition & 1 deletion app/components/modals/deposit/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
<div class="c-modal__main__info c-modal__main__info--black">
<strong><%= t('english_offers.show.current_price') %></strong>
<h3 class="u-h2 u-mt-0 u-mb-40-l"><span id="current_<%= @auction.id %>_price"><%= @auction&.currently_winning_offer&.price || '0.0' %></span></h3>
<h3 class="u-h2 u-mt-0 u-mb-40-l"><span id="current_<%= @auction.id %>_price"><%= @auction&.currently_winning_offer&.price || Money.new(0) %></span></h3>
</div>
<div class="c-modal__main__info c-modal__main__info--white c-modal__header__desc">
<div class="c-modal__main__info__wrapper u-flex u-align-start u-content-sp u-flex-col">
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ class ApplicationController < ActionController::Base
rescue_from CanCan::AccessDenied do |exception|
flash[:alert] = exception

render turbo_stream: turbo_stream.replace('flash', partial: 'common/flash', locals: { flash: })
if turbo_frame_request?
render turbo_stream: turbo_stream.replace('flash', partial: 'common/flash', locals: { flash: })
else
redirect_to root_path
end
end

def store_location
Expand Down
3 changes: 0 additions & 3 deletions app/models/concerns/invoice/payable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ def payable?
issued? || cancelled_and_have_valid_ban?
end

private

def cancelled_and_have_valid_ban?
cancelled? && Ban.valid.where(invoice_id: id).present?
end
end

0 comments on commit f9f9d44

Please sign in to comment.