render_turbo_stream 1.4.11 → 1.4.13
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 +4 -4
 - data/lib/render_turbo_stream/version.rb +1 -1
 - data/lib/render_turbo_stream.rb +7 -4
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: f7bcd60dee638218b100db8304ddda17a1d7c87df5c46d721cb541913a424abc
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 6e606363c60175378ac3cf4a652560d44e5d3b49d98a77c6a0557ff679df67fa
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e7ca3b5b395709063ebd1c30577280527e064bff16e9dc4bcf114a1a0d1a60bda33bfe105a76f0f497a8fcc39fcf59cc0f877ca05a7688666d228fa577f9d85d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 0704ce40c37540bd5135f108668348b4b86fc21cef1d8a5e94ee41a7f5e1da593fd2ec82ea9b3f7e9d7a0c47e8432716cd094beb3dcb1de2e133487d146b047c
         
     | 
    
        data/lib/render_turbo_stream.rb
    CHANGED
    
    | 
         @@ -47,9 +47,7 @@ module RenderTurboStream 
     | 
|
| 
       47 
47 
     | 
    
         | 
| 
       48 
48 
     | 
    
         
             
                if save_action
         
     | 
| 
       49 
49 
     | 
    
         
             
                  response.status = 200
         
     | 
| 
       50 
     | 
    
         
            -
                  Rails.logger.debug('start loop')
         
     | 
| 
       51 
50 
     | 
    
         
             
                  streams_on_success.each do |s|
         
     | 
| 
       52 
     | 
    
         
            -
                    Rails.logger.debug('inside loop')
         
     | 
| 
       53 
51 
     | 
    
         
             
                    if s.is_a?(Array)
         
     | 
| 
       54 
52 
     | 
    
         
             
                      streams.push(s)
         
     | 
| 
       55 
53 
     | 
    
         
             
                    elsif s.is_a?(Hash) && s[:id].present?
         
     | 
| 
         @@ -135,6 +133,8 @@ module RenderTurboStream 
     | 
|
| 
       135 
133 
     | 
    
         
             
                  response.status = 302
         
     | 
| 
       136 
134 
     | 
    
         
             
                  flash[:alert] = flash_alerts
         
     | 
| 
       137 
135 
     | 
    
         
             
                  flash[:notice] = flash_notices
         
     | 
| 
      
 136 
     | 
    
         
            +
                  Rails.logger.debug("  • Set flash[:alert] => #{flash_alerts}") if flash_alerts.present?
         
     | 
| 
      
 137 
     | 
    
         
            +
                  Rails.logger.debug("  • Set flash[:notice] => #{flash_notices}") if flash_notices.present?
         
     | 
| 
       138 
138 
     | 
    
         
             
                  render_turbo_stream([
         
     | 
| 
       139 
139 
     | 
    
         
             
                                        [
         
     | 
| 
       140 
140 
     | 
    
         
             
                                          :redirect_to,
         
     | 
| 
         @@ -145,7 +145,8 @@ module RenderTurboStream 
     | 
|
| 
       145 
145 
     | 
    
         
             
                  response.status = 302
         
     | 
| 
       146 
146 
     | 
    
         
             
                  flash[:alert] = flash_alerts
         
     | 
| 
       147 
147 
     | 
    
         
             
                  flash[:notice] = flash_notices
         
     | 
| 
       148 
     | 
    
         
            -
                  #  
     | 
| 
      
 148 
     | 
    
         
            +
                  Rails.logger.debug("  • Set flash[:alert] => #{flash_alerts}") if flash_alerts.present?
         
     | 
| 
      
 149 
     | 
    
         
            +
                  Rails.logger.debug("  • Set flash[:notice] => #{flash_notices}") if flash_notices.present?
         
     | 
| 
       149 
150 
     | 
    
         
             
                  redirect_to redirect_on_success_to
         
     | 
| 
       150 
151 
     | 
    
         | 
| 
       151 
152 
     | 
    
         
             
                else
         
     | 
| 
         @@ -159,7 +160,9 @@ module RenderTurboStream 
     | 
|
| 
       159 
160 
     | 
    
         | 
| 
       160 
161 
     | 
    
         
             
                ary = []
         
     | 
| 
       161 
162 
     | 
    
         
             
                array.each do |pr|
         
     | 
| 
       162 
     | 
    
         
            -
                  if pr. 
     | 
| 
      
 163 
     | 
    
         
            +
                  if !pr.present?
         
     | 
| 
      
 164 
     | 
    
         
            +
                    Rails.logger.warn "  WARNING render_turbo_stream: Empty element inside attributes: «#{array}»"
         
     | 
| 
      
 165 
     | 
    
         
            +
                  elsif pr.is_a?(Hash)
         
     | 
| 
       163 
166 
     | 
    
         
             
                    props = pr.symbolize_keys
         
     | 
| 
       164 
167 
     | 
    
         
             
                    raise "missing attribute :id in #{props}" if !props[:id].present?
         
     | 
| 
       165 
168 
     | 
    
         
             
                    part = (props[:partial].present? ? props[:partial] : props[:id]).gsub('-', '_')
         
     | 
    
        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: 1.4. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.4.13
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - christian
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2023-04- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-04-26 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rails
         
     |