pg_rails 7.6.10 → 7.6.12

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: 893c71adcb5816e5cbd09b2860163a03d84c56a4980388578f22ce31dd75e2c6
4
- data.tar.gz: 8debfcd4a503776a404c284add03df833a2e95efea61ba51e67068203bd72492
3
+ metadata.gz: 1f35011278d4b067bc2403d77baf705e550da975f183caf5d1e4f9c3a1972c8f
4
+ data.tar.gz: fcc091e8da09c10c9e0d83dbfaac0cd15f18700dc123b84612f8c18b8961912f
5
5
  SHA512:
6
- metadata.gz: ee18015d09a9ab2940295018f8cb5e8feb2bebb015e90b18984971f6194360cb205b614d5649155df68cbc619f173f3dcb46c9df6aa4f3f3166a00841cb244ef
7
- data.tar.gz: 77223fb87d0035b0165b4c0edf47830dfc5493a07ec567bc6628a8c3d3407dc2d16030b03d5502d310f8fbf0d2602293b1b63c82d0912166186449798db3beed
6
+ metadata.gz: '072869575c51d4b76f17f5f3eaac84ab7abb8bc284fb1fe15f9230913bd672223d7f29cdf92d08340398f2413bf411d7453fb85bd95b7a4979dc9bd30b89569a'
7
+ data.tar.gz: bb2a461752564560899be90ee149cbaac75ebf3921177c2cbc0c289b0cbd0973223c6521c15a407d9071ba21bc85b1152a9da1279a960313b97165749dfd3ebc
@@ -16,10 +16,9 @@ module PgAssociable
16
16
  query = params[:query]
17
17
  timeout_id = params[:timeout_id]
18
18
  @collection = search_in_scope(query)
19
- @count = @collection.count
20
19
  render turbo_stream:
21
20
  turbo_stream.update("#{resultados_prefix}-#{params[:id]}",
22
- partial:, locals: { collection: @collection, query:, timeout_id:, count: @count })
21
+ partial:, locals: { collection: @collection, query:, timeout_id:, clase_modelo: })
23
22
  end
24
23
 
25
24
  def search_in_scope(query)
@@ -1,7 +1,8 @@
1
- / # locals: (collection:, query:, timeout_id:, count:, field_name: nil)
1
+ / # locals: (collection:, query:, timeout_id:, field_name: nil, clase_modelo: nil)
2
2
  .resultados.inline tabindex="-1"
3
3
  div data-controller="clear-timeout" data-timeout-id="#{timeout_id}"
4
4
  ul.list-group.list-group-flush
5
+ - count = collection.count
5
6
  - if count.positive?
6
7
  .text-center.fst-italic.text-secondary.pt-1 style="font-size:0.7em"
7
8
  | #{count} resultados para "#{query}"
@@ -14,7 +15,7 @@
14
15
  li [class="list-group-item text-center text-warning-emphasis py-2" style="font-size: 0.85em"]
15
16
  | No hay resultados para "#{query}"
16
17
 
17
- - if policy(clase_modelo).new_from_associable?
18
+ - if clase_modelo.present? && policy(clase_modelo).new_from_associable?
18
19
  / TODO: unificar código repetido en asociable_controller.js
19
20
  a [key="new" href="javascript:void(0)" class="list-group-item mt-3 text-center"
20
21
  data-action="asociable#crearItem"]
@@ -1,6 +1,6 @@
1
1
  / TODO: usar ModalComponent?
2
2
  .modal[class="#{@klass} modal-#{@modal_id}" tabindex="-1" data-controller="modal"
3
- data-auto-show="true" data-remove-on-hide="false"
3
+ data-auto-show="true" data-remove-on-hide="true"
4
4
  data-modal-asociable-outlet=".asociable-#{@modal_id}"
5
5
  data-turbo-temporary="true"]
6
6
  .modal-dialog
@@ -23,7 +23,8 @@ module PgEngine
23
23
  end
24
24
 
25
25
  def modal_targeted?
26
- current_turbo_frame == 'modal_content'
26
+ current_turbo_frame.present? &&
27
+ current_turbo_frame.start_with?('modal_content')
27
28
  end
28
29
 
29
30
  def frame_embedded?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.6.10'
4
+ VERSION = '7.6.12'
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.6.10
4
+ version: 7.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso