pg_rails 7.6.42 → 7.6.43

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: 519ff463ff0b6b54cc215587c8b526a9ac0385b0f084ef40e67379d88a1d7f35
4
- data.tar.gz: 6a2ecec603c7daafaef6ee31da7b734b5e5fd810d2da4b43dc8bda4132bc6def
3
+ metadata.gz: a32df0403ce2d6750bef9c081329cf0b64d50170aa9419784c69196781c43a03
4
+ data.tar.gz: c14290d74b1c8e382dfeacdf0d6d507116d5abbd8f48196e77b2893199a212a8
5
5
  SHA512:
6
- metadata.gz: c113f2b3d27671bd93409e82c234be4a0dbcf595140b2dd2b5be95da5b5e0e115045127ce1f00d560d0973579f2befcf692ed8079d28459b870ed5256e40b04e
7
- data.tar.gz: efd482246afc90ecfbd885041f62446d337c084a12af4ba71d7f1142a63060384cac0b7b01ebcd21e037efde1339458bb8aa46b9df080b731ca2fff400ad29cb
6
+ metadata.gz: bd4228c52176a156318f9f25fffdbdfa3095192d7a18e85b9adb4c70f5b14ef71317e7a6fdfb3ac014cbd614f1a08c3c3486f1a75825d5f8c7584503e638aef7
7
+ data.tar.gz: d47e45800ff171164c443b924f6f7b7d40347ef57aaf7c15419aa378f1c3ddf1dc00642cfffe3661e0cd3ac2f299903124a092e5603450e645c940642556981f
@@ -13,7 +13,6 @@ module Admin
13
13
  end
14
14
  end
15
15
 
16
- # rubocop:disable Metrics/MethodLength
17
16
  def create
18
17
  @simple_user_notifier = SimpleUserNotifier.new(modelo_params)
19
18
  # @simple_user_notifier.message.save!
@@ -1,6 +1,5 @@
1
1
  module PgEngine
2
2
  module Resource
3
- # rubocop:disable Metrics/PerceivedComplexity
4
3
  def self.included(clazz)
5
4
  class << clazz
6
5
  # This is a per class variable, all subclasses of clazz inherit it
@@ -86,7 +85,6 @@ module PgEngine
86
85
 
87
86
  clazz.layout :set_layout
88
87
  end
89
- # rubocop:enable Metrics/PerceivedComplexity
90
88
 
91
89
  def column_options_for(_object, _attribute)
92
90
  { class: 'text-nowrap' }
@@ -293,7 +291,14 @@ module PgEngine
293
291
  protected
294
292
 
295
293
  def discard_undiscard(method)
294
+ object = instancia_modelo
296
295
  if instancia_modelo.send(method)
296
+ if method == :discard
297
+ ActiveSupport::Notifications.instrument("record_discarded.pg_engine", object)
298
+ else
299
+ ActiveSupport::Notifications.instrument("record_restored.pg_engine", object)
300
+ end
301
+
297
302
  if accepts_turbo_stream?
298
303
  body = <<~HTML.html_safe
299
304
  <pg-event data-event-name="pg:record-updated" data-reload="true" data-turbo-temporary>
@@ -475,7 +480,6 @@ module PgEngine
475
480
  end
476
481
  end
477
482
 
478
- # rubocop:disable Metrics/PerceivedComplexity
479
483
  def pg_respond_destroy(model, land_on = nil)
480
484
  if destroy_model(model)
481
485
  ActiveSupport::Notifications.instrument("record_destroyed.pg_engine", model)
@@ -513,7 +517,6 @@ module PgEngine
513
517
  redirect_back(fallback_location: root_path, status: 303)
514
518
  end
515
519
  end
516
- # rubocop:enable Metrics/PerceivedComplexity
517
520
 
518
521
  def destroy_model(model)
519
522
  @error_message = I18n.t('pg_engine.resource_not_destroyed', model: model.class)
@@ -2,7 +2,6 @@
2
2
 
3
3
  module PgEngine
4
4
  module TenantHelper
5
- # rubocop:disable Metrics/AbcSize
6
5
  def set_tenant_from_params_or_fail!
7
6
  if ActsAsTenant.current_tenant.present?
8
7
  return unless Rails.env.test?
@@ -11,11 +11,19 @@ module PgEngine
11
11
  check_postgres
12
12
  check_websocket
13
13
  check_ssl
14
+ # FIXME: make configurable
15
+ check_good_job unless ENV.fetch("HEALTH_CHECK_SKIP_GOOD_JOB", nil) == "1"
14
16
  render_up
15
17
  end
16
18
 
17
19
  private
18
20
 
21
+ def check_good_job
22
+ return if GoodJob::Process.active.count.positive?
23
+
24
+ raise PgEngine::Error, 'good_job is down'
25
+ end
26
+
19
27
  def check_postgres
20
28
  return if User.count.is_a? Integer
21
29
 
@@ -28,7 +36,6 @@ module PgEngine
28
36
  raise PgEngine::Error, 'redis is down'
29
37
  end
30
38
 
31
- # rubocop:disable Metrics/MethodLength
32
39
  def check_websocket
33
40
  result = nil
34
41
  begin
@@ -2,7 +2,6 @@
2
2
 
3
3
  module PgEngine
4
4
  module FormHelper
5
- # rubocop:disable Metrics/CyclomaticComplexity
6
5
  def pg_form_for(object, *args, &block_passed)
7
6
  resource = object
8
7
  if object.is_a? PgEngine::BaseRecordDecorator
@@ -8,7 +8,7 @@ module PgEngine
8
8
  end
9
9
 
10
10
  def deserialize(job_data)
11
- ::Current.app_name = job_data.delete('app_name')
11
+ ::Current.app_name = job_data.delete('app_name')&.to_sym
12
12
  ::Current.user = User.find(job_data.delete('user_id')) if job_data['user_id'].present?
13
13
 
14
14
  super
@@ -7,7 +7,7 @@ require 'json'
7
7
  module PgEngine
8
8
  module Mailgun
9
9
  class LogSync
10
- def self.download # rubocop:disable Metrics/AbcSize
10
+ def self.download
11
11
  key = Rails.application.credentials.dig(:mailgun, :api_key)
12
12
  mg_client = ::Mailgun::Client.new(key)
13
13
  items = []
@@ -1,6 +1,5 @@
1
1
  module PgEngine
2
2
  class Navigator
3
- # rubocop:disable Metrics/MethodLength
4
3
  def configure(navbar)
5
4
  # *****************************************************
6
5
 
@@ -1,7 +1,7 @@
1
1
  module PgEngine
2
2
  module Test
3
3
  class DummyBrand < PgEngine::SiteBrand
4
- def initialize(skip_default_url_options: Rails.env.test?) # rubocop:disable Metrics/MethodLength
4
+ def initialize(skip_default_url_options: Rails.env.test?)
5
5
  super()
6
6
 
7
7
  @default_site_brand = :factura
@@ -2,6 +2,6 @@
2
2
 
3
3
  # :nocov:
4
4
  module PgRails
5
- VERSION = '7.6.42'
5
+ VERSION = '7.6.43'
6
6
  end
7
7
  # :nocov:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.42
4
+ version: 7.6.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-24 00:00:00.000000000 Z
11
+ date: 2025-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails