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 +4 -4
- data/pg_engine/app/components/bad_request_component.rb +1 -1
- data/pg_engine/app/components/base_component.rb +3 -3
- data/pg_engine/app/components/internal_error_component.rb +1 -1
- data/pg_engine/app/controllers/pg_engine/base_controller.rb +4 -4
- data/pg_rails/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9436cbc5d0aa1e1cfae5a1b2af1c960eaa84519f3f7d31232456ee06f94acafa
|
4
|
+
data.tar.gz: e3918f63462cdcf3d14037e281cd5cb827d2fba6b05948d6e58b14c4867ca5b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff7c6b91a475b025cf7a4ad25ea2af585d497fc5f59e04d59e13e0b5131bcafe2eb7cbf81f3b123cc567a1dbc7a06b7b33c932db2d5b10e58c7d81c1a856b0fb
|
7
|
+
data.tar.gz: b765daa026c79bbc419fcc149f21255fe18367690ab9917bfe2d1bb925e3bc92771c5865acc06ad4ac4985c75db8ca25020c69797862d6c0bb6a4cef13f09ff8
|
@@ -1,10 +1,10 @@
|
|
1
1
|
class BaseComponent < ViewComponent::Base
|
2
|
-
def
|
2
|
+
def alert_wrapped(view_context)
|
3
3
|
AlertComponent.new(type: alert_type)
|
4
|
-
.with_content(
|
4
|
+
.with_content(render_in(view_context))
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
7
|
+
def alert_type
|
8
8
|
# :nocov:
|
9
9
|
raise 'implement in subclass'
|
10
10
|
# :nocov:
|
@@ -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)
|
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.
|
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),
|
data/pg_rails/lib/version.rb
CHANGED