Skip to content

Commit

Permalink
more bugz
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspermayone committed Aug 4, 2024
1 parent 2db6d5c commit c052b0a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
3.2.4
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ DEPENDENCIES
web-console

RUBY VERSION
ruby 3.2.0p0
ruby 3.2.4p170

BUNDLED WITH
2.5.9
8 changes: 4 additions & 4 deletions app/controllers/loaners_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def return
StatsD.increment("loaner_return_attempt")
StatsD.measure('loaner.return_action') do
if @loaner.present?
@loaner.mark_as_returned
@loaner.return!
StatsD.increment("loaner_returned")
redirect_to loaners_path, notice: "Asset checked in successfully."
else
Expand All @@ -65,7 +65,7 @@ def enable
StatsD.increment("loaner_enable_attempt")
StatsD.measure('loaner.enable_action') do
if @loaner.present?
@loaner.mark_as_enabled
@loaner.enable!
StatsD.increment("loaner_enabled")
redirect_to loaners_path, notice: "Asset marked as enabled successfully."
else
Expand Down Expand Up @@ -93,7 +93,7 @@ def broken
StatsD.increment("loaner_broken_attempt")
StatsD.measure('loaner.broken_action') do
if @loaner.present?
@loaner.mark_as_broken
@loaner.broken!
StatsD.increment("loaner_broken")
redirect_to loaners_path, notice: "Asset marked as broken successfully."
else
Expand All @@ -107,7 +107,7 @@ def repair
StatsD.increment("loaner_repair_attempt")
StatsD.measure('loaner.repair_action') do
if @loaner.present?
@loaner.mark_as_repaired
@loaner.repair!
StatsD.increment("loaner_repaired")
redirect_to loaners_path, notice: "Asset marked as repaired successfully."
else
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/loans_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def extend
flash[:alert] = 'Loan not found.'
end

redirect_to loans_list_out_path
redirect_to overview_path
end

def repair
Expand Down
1 change: 1 addition & 0 deletions app/models/loaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def chrome_enable
state :loaned, display: "Loaned"
state :disabled, display: "Disabled"
state :maintenance, display: "Maintenance"
state :decommissioned, display: "Decommissioned"

after_all_transitions :log_status_change

Expand Down
8 changes: 7 additions & 1 deletion app/views/main/overview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<td>
<%= link_to loaner.freindly_id, loaner_path(loaner) %>
</td>
<td><%= loaner.asset_tag %></td>
<td><%= link_to loaner.asset_tag, loaner_path(loaner), class: "lnk" %></td>
<td><%= link_to loan.borrower.email, borrower_path(loan.borrower) %></td>
<td><%= loan.loaned_at.strftime("%A, %B %e at %l:%M %p") %></td>
<td><%= loan.reason.humanize %></td>
Expand Down Expand Up @@ -150,5 +150,11 @@
margin-right: 10px;
margin-left: 10px;
}

.lnk {
color: #000;
font-style: italic;
text-decoration: underline;
}
</style>
</div>

0 comments on commit c052b0a

Please sign in to comment.