pg_rails 7.0.8.pre.alpha.89 → 7.0.8.pre.alpha.90

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8141d5335d0993a419e183b7cb6ae3d30c89d77b2f0e620b03279f5971e6d21
4
- data.tar.gz: 93f2de289e395627774991e6464d212430ca264cf5b7ec6ab5e89d007ed82353
3
+ metadata.gz: 9436cbc5d0aa1e1cfae5a1b2af1c960eaa84519f3f7d31232456ee06f94acafa
4
+ data.tar.gz: e3918f63462cdcf3d14037e281cd5cb827d2fba6b05948d6e58b14c4867ca5b4
5
5
  SHA512:
6
- metadata.gz: fc6fa69e44fb872daae120dbadfa520789670fa96028e638de435b39cf44d9c183e5a42de0efe631849131b06c2f58808c5b2a207141f3c6c84cd92bb9e807da
7
- data.tar.gz: 2a8f1e7b7d327364f58be8844f1d9b77468cb6154b0526b5ce4ccaa80037e89a07df9d6927471a37587425a9c634dbbfc45a567dbe7f022dc6a124cf97bec628
6
+ metadata.gz: ff7c6b91a475b025cf7a4ad25ea2af585d497fc5f59e04d59e13e0b5131bcafe2eb7cbf81f3b123cc567a1dbc7a06b7b33c932db2d5b10e58c7d81c1a856b0fb
7
+ data.tar.gz: b765daa026c79bbc419fcc149f21255fe18367690ab9917bfe2d1bb925e3bc92771c5865acc06ad4ac4985c75db8ca25020c69797862d6c0bb6a4cef13f09ff8
@@ -1,5 +1,5 @@
1
1
  class BadRequestComponent < BaseComponent
2
- def self.alert_type
2
+ def alert_type
3
3
  :alert
4
4
  end
5
5
 
@@ -1,10 +1,10 @@
1
1
  class BaseComponent < ViewComponent::Base
2
- def self.alert_wrapped(view_context)
2
+ def alert_wrapped(view_context)
3
3
  AlertComponent.new(type: alert_type)
4
- .with_content(new.render_in(view_context))
4
+ .with_content(render_in(view_context))
5
5
  end
6
6
 
7
- def self.alert_type
7
+ def alert_type
8
8
  # :nocov:
9
9
  raise 'implement in subclass'
10
10
  # :nocov:
@@ -4,7 +4,7 @@ class InternalErrorComponent < BaseComponent
4
4
  super
5
5
  end
6
6
 
7
- def self.alert_type
7
+ def alert_type
8
8
  :critical
9
9
  end
10
10
 
@@ -34,13 +34,13 @@ module PgEngine
34
34
  def internal_error(error)
35
35
  pg_err error
36
36
 
37
- render_my_component(InternalErrorComponent, :internal_server_error)
37
+ render_my_component(InternalErrorComponent.new, :internal_server_error)
38
38
  end
39
39
 
40
40
  def invalid_authenticity_token(err)
41
41
  pg_warn err
42
42
 
43
- render_my_component(BadRequestComponent, :bad_request)
43
+ render_my_component(BadRequestComponent.new, :bad_request)
44
44
  end
45
45
 
46
46
  before_action do
@@ -91,7 +91,7 @@ module PgEngine
91
91
 
92
92
  protected
93
93
 
94
- def render_my_component(component, status) # rubocop:disable Metrics/AbcSize
94
+ def render_my_component(component, status)
95
95
  respond_to do |format|
96
96
  format.html do
97
97
  render component.alert_wrapped(view_context),
@@ -100,7 +100,7 @@ module PgEngine
100
100
  end
101
101
 
102
102
  format.turbo_stream do
103
- flash.now[component.alert_type] = component.new.render_in(view_context)
103
+ flash.now[component.alert_type] = component.render_in(view_context)
104
104
 
105
105
  render turbo_stream: (turbo_stream.remove_all('.modal') +
106
106
  render_turbo_stream_flash_messages),
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.89'
4
+ VERSION = '7.0.8-alpha.90'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.8.pre.alpha.89
4
+ version: 7.0.8.pre.alpha.90
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso