pg_rails 7.6.22.pre.1 → 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: 5b76399429a5de2afde862c553eeeb0cd141ae94e652ff063a7ea2e03a861131
4
- data.tar.gz: 4cab26aca4226a0333dd69fb264683315cb12d283f173e9593530b6f5f03174f
3
+ metadata.gz: e11eaaf87267c270b7a5dc436af8bc9408b06c98f576f83131e1f0dc8bc90fd1
4
+ data.tar.gz: 102b832b63cefc8ad4036af4fbbf4737fb3b7bffba8a3c265e9bad027a91ff46
5
5
  SHA512:
6
- metadata.gz: e50ff4f64cd0106777f6658335df10db9b1c23bba3a8310a80571e2899d7dc51a14bc1b7679be27654801e3d2d5dc357f27b574caa1c66b3fd842ca1ece1d7ae
7
- data.tar.gz: e5f551aa8b95bfae7131e61b3045f8157c92a0ab55cebea2ec7d203cf948f7b7ff535d6f0f3d6fe233f097d0de266380890b0f2a660e8ad53a2522094080d943
6
+ metadata.gz: 638c860b8f356d0fca74690f744f80ea103cfe637cb15e6619e49d98f70f4f9288d26cfcf17896211f656a707b6eab7565e0145e02f84ea260a5a39a8a0faade
7
+ data.tar.gz: 07e01cadab3025d652009783410535ccf47037a33d1f1cbb26e9f18020e36b6c34ba05886d78d5112ac95cbd1e885515a7f3c3a2be4333b61bfa75955964c7ea
@@ -2,6 +2,11 @@ module Users
2
2
  class InvitationsController < Devise::InvitationsController
3
3
  include PgEngine::TenantHelper
4
4
 
5
+ before_action only: :new do
6
+ # Porque el link for new no tiene turbo-frame="_top"
7
+ @turbo_page_requires_reload = true
8
+ end
9
+
5
10
  before_action only: %i[new create] do
6
11
  set_tenant_from_params_or_fail!
7
12
 
@@ -12,9 +17,6 @@ module Users
12
17
  add_breadcrumb UserAccount.nombre_plural
13
18
  add_breadcrumb UserAccount.new.decorate.submit_default_value
14
19
 
15
- # Porque el link for new no tiene turbo-frame="_top"
16
- @turbo_page_requires_reload = true
17
-
18
20
  @no_main_frame = true
19
21
  @container_class = 'container border pb-3 my-3'
20
22
  @container_style = 'max-width: 50em; xborder-left: 1px solid grey'
@@ -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
 
@@ -9,7 +9,22 @@ module PgEngine
9
9
  before_action { @email_object = params[:email_object] }
10
10
 
11
11
  before_action do
12
- path = Rails.application.assets.find_asset(logo_footer_name).filename
12
+ if Rails.application.assets.present?
13
+ # Can compile assets
14
+ path = Rails.application.assets.find_asset(logo_footer_name).filename
15
+ else
16
+ # Can't compile assets, so must be precompiled
17
+ name = Rails.application.assets_manifest.files.select do |_k, v|
18
+ v['logical_path'].include?(logo_footer_name)
19
+ end
20
+ name = name.keys.first
21
+ if name.nil?
22
+ raise "Asset was not precompiled: #{logo_footer_name}"
23
+ end
24
+
25
+ path = Rails.public_path.join('assets', name)
26
+ end
27
+
13
28
  png_data = File.read(path)
14
29
  attachments.inline[logo_footer_name] = png_data
15
30
  @footer_image_src = attachments[logo_footer_name].url
@@ -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-1'
4
+ VERSION = '7.6.22-3'
5
5
  end
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.22.pre.1
4
+ version: 7.6.22.pre.3
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: 2024-11-08 00:00:00.000000000 Z
11
+ date: 2024-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails