render_turbo_stream 4.3.10 → 4.3.11

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: e7c77d7913ced14947092af6b05456c79581758a79ae83d9c4266cb6600a4922
4
- data.tar.gz: 46b5b11f4f465b1956948996e3c9cfb47d79c8ea9becf03f76d32337320e4f1e
3
+ metadata.gz: 1632f986315bf12186e902f24959cd243b541ba1cf6055e88d53ea2019564855
4
+ data.tar.gz: 398cbcba033712aab8d7bf1022b40c5c47cb55820026e11387db4aa5d53c137f
5
5
  SHA512:
6
- metadata.gz: 2ece99c25ab9f6dc65d72c8d16993c81d1c6f4f0681414e14d6bff78c49e37494d3e3ddcd567b1acc10b0b642b22bbb458800167dd0e327dcabce679a712fa2f
7
- data.tar.gz: e71788a07ca646d45ae6efe9fcbe536a52adb74c0c57435757949b9acbcd1f8f2f8468382f2449c2b8fa10c2efd75706efca88d4a8ea29aab732b4e1bc30d972
6
+ metadata.gz: b2d46b22f8505bc1c6a5b7cd1c388e848dc90a7353e6cf86cfdb3c9a776bedd85be3f01cc25349b99b784d3aadbb682a8f23dc70d0a8a861db02131a6b1950d3
7
+ data.tar.gz: 73bec9e074afbf69bcd3765fd8100cb6721897bd70dd2d9488f079bf0daf39f2c54feb7f8cc881bbd45b4eddb7678d86cce767bfab583c53a92b97bc41ee3ae1
data/README.md CHANGED
@@ -240,6 +240,10 @@ In order to avoid this kind of tedious coding, the gem has a kind of fallback bu
240
240
  3. If all that not is found it raises a exception
241
241
  4. wraps the partial within the `turbo_stream.*` and sends this to the front.
242
242
 
243
+ **Debugging**
244
+
245
+ If a save action fails, `turbo_stream_save` and `turbo_channel_save` are logging the output from `Model.errors.full_messages` to the console, at log-level `:debug`.
246
+
243
247
  # Request Testing
244
248
 
245
249
  To test if the whole system works together, including javascript actions, so that finally a part reaches the surface, there is **Capybara** system testing. But it is a good practice to **break tests into smaller pieces**. So, there are helpers for **enabling the much faster request tests that are much easier to maintain**.
@@ -183,6 +183,10 @@ module RenderTurboStream
183
183
  raise libs.action_errors(turbo_actions).join(', ')
184
184
  end
185
185
 
186
+ unless save_action
187
+ RenderTurboStream::Libs.debug_save_errors(object, flash_controller_action_name)
188
+ end
189
+
186
190
  # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
187
191
  #== RENDER TO CHANNEL
188
192
  # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -67,6 +67,7 @@ module RenderTurboStream
67
67
 
68
68
  unless save_action
69
69
  response.status = 422
70
+ RenderTurboStream::Libs.debug_save_errors(object, flash_controller_action_name)
70
71
  end
71
72
 
72
73
  # xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -84,5 +84,16 @@ module RenderTurboStream
84
84
  end
85
85
  end
86
86
 
87
+ def self.debug_save_errors(object, controller_action_name)
88
+ if object.id.present?
89
+ Rails.logger.debug(" • #{controller_action_name} #{object.class}:#{object.id} FAILED:")
90
+ else
91
+ Rails.logger.debug(" • #{controller_action_name} #{object.class} FAILED:")
92
+ end
93
+ object.errors.full_messages.each do |e|
94
+ Rails.logger.debug(" => #{e}")
95
+ end
96
+ end
97
+
87
98
  end
88
99
  end
@@ -1,3 +1,3 @@
1
1
  module RenderTurboStream
2
- VERSION = "4.3.10"
2
+ VERSION = "4.3.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: render_turbo_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.10
4
+ version: 4.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - christian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-06 00:00:00.000000000 Z
11
+ date: 2023-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails