pg_rails 7.6.21.pre.1 → 7.6.21.pre.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6698336321ce3bb886aa1de70219bab209e2f8b2f1b3f867282a29f1f1ebf5a5
|
4
|
+
data.tar.gz: fae76eef1209ba3e463740c8818ebd406a0b387eab151d964519fe0f5a389cec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55b7bc4417466c09110d4e48c4ee7355fdfc7bcf8e153592f9e0418fe518803953b73a6c3584274992aa3624cf6073b0ddab327e9971d7bb17923fbd176322ed
|
7
|
+
data.tar.gz: c51ce96d9af18a24111adc2130ae196290df313198561b4d6b23f59447b6d5d7762c5907bb1bcac59c7aabfbfc439b75324e06901d48de98181462b95c7e4582
|
@@ -3,6 +3,14 @@ class Current < ActiveSupport::CurrentAttributes
|
|
3
3
|
# attribute :request_id, :user_agent, :ip_address
|
4
4
|
|
5
5
|
# resets { Time.zone = nil }
|
6
|
+
def active_user_account
|
7
|
+
# Para los jobs
|
8
|
+
if attributes[:active_user_account].nil? && user.present? && account.present?
|
9
|
+
attributes[:active_user_account] = user.active_user_account_for(account)
|
10
|
+
end
|
11
|
+
|
12
|
+
super
|
13
|
+
end
|
6
14
|
|
7
15
|
def tid
|
8
16
|
active_user_account.to_param
|
@@ -132,12 +132,12 @@ class User < ApplicationRecord
|
|
132
132
|
|
133
133
|
class Error < PgEngine::Error; end
|
134
134
|
|
135
|
-
def default_account
|
136
|
-
|
135
|
+
# def default_account
|
136
|
+
# raise Error, 'El usuario debe tener cuenta' if accounts.empty?
|
137
137
|
|
138
|
-
|
139
|
-
|
140
|
-
end
|
138
|
+
# user_accounts.first.account
|
139
|
+
# # throw :warden, scope: :user, message: :user_not_belongs_to_account
|
140
|
+
# end
|
141
141
|
|
142
142
|
deprecate :current_account, deprecator: PgEngine.deprecator
|
143
143
|
|
data/pg_engine/db/seeds.rb
CHANGED
@@ -13,4 +13,4 @@ rené = FactoryBot.create(:user, email: 'rene@bien.com', nombre: 'René', apelli
|
|
13
13
|
confirmed_at: Time.now)
|
14
14
|
|
15
15
|
racionalismo.user_accounts.create!(user: baruch, profiles: [:account__owner])
|
16
|
-
racionalismo.user_accounts.create!(user: rené, profiles: [
|
16
|
+
racionalismo.user_accounts.create!(user: rené, profiles: [])
|
data/pg_rails/lib/version.rb
CHANGED