pg_rails 7.5.6 → 7.5.7

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: b62210d098125764e407b10038d44a3e3fe91a52f6eff700fd83555dded8d194
4
- data.tar.gz: 4e9ac223dd652c00045af466a82af01ea07062f8968947286c304014ea3cb5ac
3
+ metadata.gz: d700901741523887ccac3c92bc1e266a4ec57f1cf2794865aa2c1bc4a30a5ae2
4
+ data.tar.gz: e8e55331eb22f7168d483ce8e1eec5965b23cec8f8421bfbe4ff58e870d874af
5
5
  SHA512:
6
- metadata.gz: b4cb69cca012bf23c8e1229353cd8b346150bc3029b9e45e995ce2f8ccb74d375c4019ce50ca894aaa9ef7cb5036781dcec219fa8ce108b64264e786d7467cda
7
- data.tar.gz: 074b884d3867fffc9a1835aa59ca9c69dc9b64c60042d49151bbc9b60bad72d12488964be429e4eb21626dcb251b6ae8ed4b61d58a40f62cc7d845a12118e72b
6
+ metadata.gz: 63ea0b3be1e39bcdc8436269b539945000b11e6f40f03e69eb3f5e897bf1ba1ca45a5a054d13c0e3f37c5fd5eb878d91b092b31174a796012b5a8b87ccd0e625
7
+ data.tar.gz: c6808a080fe3a4dc2769bf35ac29662f4875229d323c31f793481c3460b44d41a8984010f328a4a380d842f2aa3e5ddbeaed9853ce5013b4913cf53516dc848d
@@ -7,6 +7,8 @@ module Admin
7
7
  include PgEngine::Resource
8
8
 
9
9
  self.clase_modelo = UserAccount
10
+ self.nested_class = Account
11
+ self.nested_key = :account_id
10
12
 
11
13
  before_action(only: :index) { authorize UserAccount }
12
14
 
@@ -9,6 +9,8 @@ module PgEngine
9
9
  # FIXME: make a POST route
10
10
  return head :bad_request unless dev_user_or_env?
11
11
 
12
+ Current.namespace = nil
13
+
12
14
  usuario = User.find(params[:id])
13
15
  if usuario.confirmed_at.present?
14
16
  sign_in(:user, usuario)
@@ -25,3 +25,5 @@ table.table.table-borderless.table-sm.w-auto.mb-0.m-3
25
25
  tr
26
26
  th = t('attributes.discarded_at')
27
27
  td = @account.discarded_at
28
+
29
+ = embed_index @account, :user_accounts
@@ -44,7 +44,9 @@ Rails.application.routes.draw do
44
44
  end
45
45
  end
46
46
  pg_resource(:users)
47
- pg_resource(:accounts)
47
+ pg_resource(:accounts) do
48
+ pg_resource(:user_accounts)
49
+ end
48
50
  pg_resource(:user_accounts)
49
51
  end
50
52
  if defined? ActiveAdmin
@@ -19,6 +19,14 @@ module PgEngine
19
19
  Dir.glob("#{overrides}/**/*.rb").each do |override|
20
20
  load override
21
21
  end
22
+
23
+ ActiveStorage::BaseController.class_eval do
24
+ around_action :set_without_tenant
25
+
26
+ def set_without_tenant(&)
27
+ ActsAsTenant.without_tenant(&)
28
+ end
29
+ end
22
30
  end
23
31
 
24
32
  initializer 'pg_engine.set_exceptions_app' do
@@ -0,0 +1,16 @@
1
+ require 'rails_helper'
2
+
3
+ describe 'representations controller' do
4
+ let(:file) { File.open("#{PgEngine::Engine.root}/spec/fixtures/test.pdf") }
5
+
6
+ it do
7
+ categoria = create :categoria_de_cosa
8
+ categoria.file.attach(io: file, filename: 'test.pdf')
9
+ path = polymorphic_url(categoria.file.preview(:thumb), only_path: true)
10
+ expect(path).to start_with '/rails/active_storage/representations/redirect/'
11
+ get path
12
+ ActiveStorage::Current.url_options = { host: 'www.example.com' }
13
+ expect(response).to have_http_status(:redirect)
14
+ expect(response.headers['location']).to include '/rails/active_storage/disk/'
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.5.6'
4
+ VERSION = '7.5.7'
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.5.6
4
+ version: 7.5.7
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-09-19 00:00:00.000000000 Z
11
+ date: 2024-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -875,6 +875,7 @@ files:
875
875
  - pg_engine/spec/models/user_spec.rb
876
876
  - pg_engine/spec/overrides/audited_audit_spec.rb
877
877
  - pg_engine/spec/pg_engine/pdf_preview_generator_spec.rb
878
+ - pg_engine/spec/requests/active_storage_spec.rb
878
879
  - pg_engine/spec/requests/admin/eventos_spec.rb
879
880
  - pg_engine/spec/requests/base_controller_requests_spec.rb
880
881
  - pg_engine/spec/requests/current_attributes_spec.rb