pg_rails 7.6.22.pre.2 → 7.6.22.pre.3

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: 82557632c412afc306681cc0a0b939032d6085ae330754261bb83a7ecee70703
4
- data.tar.gz: 57921d4c26b686254a7fe02dd2e488a05ee6948987ed1166de7ef1a1543c6c6f
3
+ metadata.gz: e11eaaf87267c270b7a5dc436af8bc9408b06c98f576f83131e1f0dc8bc90fd1
4
+ data.tar.gz: 102b832b63cefc8ad4036af4fbbf4737fb3b7bffba8a3c265e9bad027a91ff46
5
5
  SHA512:
6
- metadata.gz: deb3aefaabfbf76b6be7efd0093b456df0f1e25f685428bfce6481a5c49e14bf2248eb44cf216eb9b8e7aeac85652da048d1b402ff75c65e833c4b995bc39fb1
7
- data.tar.gz: f4f5d38259d76db1d18dbf5a5abf18f1b596ae26ec9d8eceee7d58c4742407dd4dcc0aba2759a72e975607484dfb18be9524c3299c5416b2ca66b3f4278172f0
6
+ metadata.gz: 638c860b8f356d0fca74690f744f80ea103cfe637cb15e6619e49d98f70f4f9288d26cfcf17896211f656a707b6eab7565e0145e02f84ea260a5a39a8a0faade
7
+ data.tar.gz: 07e01cadab3025d652009783410535ccf47037a33d1f1cbb26e9f18020e36b6c34ba05886d78d5112ac95cbd1e885515a7f3c3a2be4333b61bfa75955964c7ea
@@ -7,12 +7,30 @@ module PgEngine
7
7
  # Aparentemente es necesario definir url_options cuando los parámetros
8
8
  # pueden cambiar a lo largo del lifecycle de la request
9
9
  def url_options
10
- super.merge(PgEngine.site_brand.default_url_options).merge(tid: _current_tid)
10
+ base = if defined? super
11
+ super
12
+ else
13
+ {}
14
+ end
15
+
16
+ base.merge(_brand_options_with_tid)
11
17
  end
12
18
 
13
19
  # Aunque parece intuitivo que se podría definir solamente url_options,
14
20
  # es importante que default_url_options también esté definido
15
21
  def default_url_options
22
+ # Hay contextos en que está definido el método, como en los controllers
23
+ # y otros en los que no, como la Navbar
24
+ base = if defined? super
25
+ super
26
+ else
27
+ {}
28
+ end
29
+
30
+ base.merge(_brand_options_with_tid)
31
+ end
32
+
33
+ def _brand_options_with_tid
16
34
  PgEngine.site_brand.default_url_options.merge(tid: _current_tid)
17
35
  end
18
36
 
@@ -21,3 +21,12 @@ ActionMailer::MailDeliveryJob.rescue_from EOFError,
21
21
  end
22
22
 
23
23
  ActionMailer::Base.register_observer(PgEngine::EmailObserver)
24
+
25
+ if Rails.env.development?
26
+ ActionMailer::Preview.class_eval do
27
+ def initialize(params = {})
28
+ @params = params
29
+ Current.app_name = params[:app_name]&.to_sym
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.6.22-2'
4
+ VERSION = '7.6.22-3'
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.22.pre.2
4
+ version: 7.6.22.pre.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso