solid_errors 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e69dbe088ff461a32c395c79dff5d4d6ccfef5d3afebd2edd32cad153f7e8a02
4
- data.tar.gz: 205c26874a40a3e4427051709e0217b5dd6c5d8bf32abc343150754b69b13d31
3
+ metadata.gz: 3eb4ed02d7765415bc5b1a719cc0a7e2e0b61b3a7cf174536300ab8c0fea18a2
4
+ data.tar.gz: 5bab7cc225b36530ba37a31a6fcabb29f12192fd62bfc56405164c374453bbcd
5
5
  SHA512:
6
- metadata.gz: 07ac740b18e82c3f8cbe0a0df520e0b48daa5cd3db100b39787c78e9c87b17e7e0a139b799aa9111d13613e96b1f6af67ce7dc9cacb90fb2333175aca03f5216
7
- data.tar.gz: 2c89cb709d53fc8cbbdff2e1f9db2d3ade809e206a747a8d2c2bbfdc2144f394d4c8f731c6f6fa94979359a0f6a8690f23f305ed6714ca2f657fcc3f1667ade4
6
+ metadata.gz: 5cd1e176b16aa361b52526d1e1612c048cf9638e33c87fa1196ef999b332c57d9356e88abdc76899705f3a828938ce8efbe50813d330e74f9ff0df11b4d4bcb8
7
+ data.tar.gz: bddc3ee8731021723630d9bfc25c207fd6317327a65df6c1201df15cc5e5df326f11bd22c24eade3007fbcdca07a757aaf49b1a9c41cf222b310fb32eed0a45f
@@ -4,11 +4,17 @@ module SolidErrors
4
4
 
5
5
  # GET /errors
6
6
  def index
7
+ errors_table = Error.arel_table
8
+ occurrences_table = Occurrence.arel_table
9
+ recent_occurrence = occurrences_table
10
+ .project(occurrences_table[:created_at].maximum)
11
+ .as('recent_occurrence')
12
+
7
13
  @errors = Error.unresolved
8
14
  .joins(:occurrences)
9
- .select('errors.*, MAX(occurrences.created_at) AS recent_occurrence')
10
- .group('errors.id')
11
- .order('recent_occurrence DESC')
15
+ .select(errors_table[Arel.star], recent_occurrence)
16
+ .group(errors_table[:id])
17
+ .order(recent_occurrence: :desc)
12
18
  end
13
19
 
14
20
  # GET /errors/1
@@ -1,12 +1,12 @@
1
1
  <div class="inline-flex items-center justify-start flex-wrap gap-3 whitespace-nowrap">
2
2
  <% if current_controller.errors? && !current_action.errors_index? %>
3
- <%= link_to errors_path, class: button_classes(icon: true) do %>
3
+ <%= link_to errors_path, class: "inline-flex items-center justify-center gap-2 font-medium cursor-pointer border rounded-lg py-3 px-5 bg-gray-100 text-initial border-gray-300 hover:ring-gray-200 hover:ring-8" do %>
4
4
  <%= bootstrap_svg "arrow-left" %>
5
5
  <span>Back to errors</span>
6
6
  <% end %>
7
7
  <% end %>
8
8
 
9
- <%= button_to error_path(error), method: :patch, class: button_classes(type: :primary_ghost), params: { error: { resolved_at: Time.now } } do %>
9
+ <%= button_to error_path(error), method: :patch, class: "inline-flex items-center justify-center gap-2 font-medium cursor-pointer border rounded-lg py-3 px-5 bg-transparent text-blue-500 border-blue-500 hover:ring-blue-200 hover:ring-8", params: { error: { resolved_at: Time.now } } do %>
10
10
  Resolve Error<span class="sr-only"> #<%= error.id %></span>
11
11
  <% end %>
12
12
  </div>
@@ -17,7 +17,7 @@
17
17
  <%= time_ago_in_words error.occurrences.maximum(:created_at), scope: 'datetime.distance_in_words.short' %>
18
18
  </td>
19
19
  <td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-3">
20
- <%= button_to error_path(error), method: :patch, class: button_classes(type: :primary_ghost), params: { error: { resolved_at: Time.now } } do %>
20
+ <%= button_to error_path(error), method: :patch, class: "inline-flex items-center justify-center gap-2 font-medium cursor-pointer border rounded-lg py-3 px-5 bg-transparent text-blue-500 border-blue-500 hover:ring-blue-200 hover:ring-8", params: { error: { resolved_at: Time.now } } do %>
21
21
  Resolve<span class="sr-only">, Error #<%= error.id %></span>
22
22
  <% end %>
23
23
  </td>
@@ -14,5 +14,3 @@
14
14
  <%= render partial: "solid_errors/errors/error", collection: @errors %>
15
15
  </tbody>
16
16
  </table>
17
-
18
- <%#= @errors.count %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidErrors
4
- VERSION = "0.2.6"
4
+ VERSION = "0.2.8"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Margheim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-14 00:00:00.000000000 Z
11
+ date: 2024-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails