pg_rails 7.0.5 → 7.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/pg_associable/lib/pg_associable/engine.rb +0 -4
- data/pg_associable/lib/pg_associable/simple_form_initializer.rb +2 -2
- data/pg_associable/spec/pg_associable/helpers_spec.rb +4 -3
- data/pg_engine/app/admin/accounts.rb +25 -0
- data/pg_engine/{lib/templates/activeadmin → app/admin}/audits.rb +3 -3
- data/pg_engine/app/admin/dashboard.rb +34 -0
- data/pg_engine/app/admin/user_accounts.rb +26 -0
- data/pg_engine/{lib/templates/activeadmin → app/admin}/users.rb +1 -2
- data/pg_engine/app/assets/javascripts/active_admin.js +1 -0
- data/pg_engine/app/assets/stylesheets/active_admin.scss +17 -0
- data/pg_engine/app/controllers/admin/accounts_controller.rb +33 -0
- data/pg_engine/app/controllers/admin/user_accounts_controller.rb +33 -0
- data/pg_engine/app/controllers/admin/users_controller.rb +47 -0
- data/pg_engine/app/controllers/pg_engine/resource_helper.rb +10 -5
- data/pg_engine/app/decorators/account_decorator.rb +16 -0
- data/pg_engine/app/decorators/pg_engine/base_decorator.rb +14 -12
- data/pg_engine/app/decorators/user_account_decorator.rb +19 -0
- data/pg_engine/app/decorators/user_decorator.rb +20 -0
- data/pg_engine/app/helpers/pg_engine/flash_helper.rb +1 -1
- data/pg_engine/app/models/account.rb +39 -0
- data/pg_engine/app/models/user.rb +61 -0
- data/pg_engine/app/models/user_account.rb +46 -0
- data/pg_engine/app/policies/account_policy.rb +31 -0
- data/pg_engine/app/policies/pg_engine/application_policy.rb +1 -1
- data/pg_engine/app/policies/user_account_policy.rb +31 -0
- data/pg_engine/app/policies/user_policy.rb +31 -0
- data/pg_engine/app/views/admin/accounts/_account.html.slim +1 -0
- data/pg_engine/app/views/admin/accounts/_form.html.slim +12 -0
- data/pg_engine/app/views/admin/accounts/edit.html.slim +5 -0
- data/pg_engine/app/views/admin/accounts/new.html.slim +5 -0
- data/pg_engine/app/views/admin/accounts/show.html.slim +27 -0
- data/pg_engine/app/views/admin/user_accounts/_form.html.slim +12 -0
- data/pg_engine/app/views/admin/user_accounts/_user_account.html.slim +1 -0
- data/pg_engine/app/views/admin/user_accounts/edit.html.slim +5 -0
- data/pg_engine/app/views/admin/user_accounts/new.html.slim +5 -0
- data/pg_engine/app/views/admin/user_accounts/show.html.slim +24 -0
- data/pg_engine/app/views/admin/users/_form.html.slim +12 -0
- data/pg_engine/app/views/admin/users/_user.html.slim +1 -0
- data/pg_engine/app/views/admin/users/edit.html.slim +5 -0
- data/pg_engine/app/views/admin/users/new.html.slim +5 -0
- data/pg_engine/app/views/admin/users/show.html.slim +27 -0
- data/pg_engine/config/initializers/active_admin.rb +355 -0
- data/pg_engine/config/initializers/devise.rb +313 -0
- data/pg_engine/config/locales/devise.en.yml +65 -0
- data/pg_engine/config/routes.rb +11 -0
- data/pg_engine/db/migrate/20240205194218_devise_create_users.rb +47 -0
- data/pg_engine/db/migrate/20240208234111_unaccent.rb +5 -0
- data/pg_engine/db/migrate/20240208234901_install_audited.rb +32 -0
- data/pg_engine/db/migrate/20240210025702_create_active_admin_comments.rb +16 -0
- data/pg_engine/db/migrate/20240211152951_create_accounts.rb +24 -0
- data/pg_engine/db/migrate/20240211153049_create_user_accounts.rb +20 -0
- data/pg_engine/db/seeds.rb +5 -0
- data/pg_engine/lib/pg_engine/core_ext.rb +14 -14
- data/pg_engine/lib/pg_engine/engine.rb +16 -2
- data/pg_engine/lib/pg_engine/route_helpers.rb +2 -2
- data/pg_engine/lib/tasks/auto_anotar_modelos.rake +2 -2
- data/pg_engine/spec/controllers/admin/accounts_controller_spec.rb +206 -0
- data/pg_engine/spec/controllers/admin/user_accounts_controller_spec.rb +189 -0
- data/pg_engine/spec/controllers/admin/users_controller_spec.rb +180 -0
- data/pg_engine/spec/factories/accounts.rb +11 -0
- data/pg_engine/spec/factories/user_accounts.rb +21 -0
- data/pg_engine/spec/factories/users.rb +59 -0
- data/pg_engine/spec/models/account_spec.rb +13 -0
- data/pg_engine/spec/models/user_account_spec.rb +13 -0
- data/pg_engine/spec/models/user_spec.rb +13 -0
- data/pg_layout/lib/pg_layout/engine.rb +0 -1
- data/pg_rails/lib/version.rb +1 -1
- data/pg_scaffold/lib/generators/pg_pundit/templates/policy.rb +1 -1
- data/pg_scaffold/lib/generators/pg_rspec/scaffold/templates/controller_spec.rb +4 -4
- data/pg_scaffold/lib/generators/pg_slim/templates/show.html.slim +4 -4
- data/pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_de_atributos.rb +2 -2
- data/pg_scaffold/spec/generators_spec.rb +1 -1
- metadata +56 -4
data/pg_rails/lib/version.rb
CHANGED
@@ -54,10 +54,10 @@ RSpec.describe <%= controller_class_name %>Controller do
|
|
54
54
|
end
|
55
55
|
<% end -%>
|
56
56
|
|
57
|
-
let(:
|
57
|
+
let(:logged_user) { create :user, :developer }
|
58
58
|
|
59
59
|
before do
|
60
|
-
sign_in
|
60
|
+
sign_in logged_user if logged_user.present?
|
61
61
|
end
|
62
62
|
|
63
63
|
describe 'routing' do
|
@@ -85,7 +85,7 @@ RSpec.describe <%= controller_class_name %>Controller do
|
|
85
85
|
end
|
86
86
|
|
87
87
|
context 'when user is not logged in' do
|
88
|
-
let(:
|
88
|
+
let(:logged_user) { nil }
|
89
89
|
|
90
90
|
it 'redirects to login path' do
|
91
91
|
subject
|
@@ -99,7 +99,7 @@ RSpec.describe <%= controller_class_name %>Controller do
|
|
99
99
|
|
100
100
|
it do
|
101
101
|
subject
|
102
|
-
expect(assigns(:collection)).
|
102
|
+
expect(assigns(:collection)).not_to include(<%= nombre_tabla_completo_singular %>)
|
103
103
|
end
|
104
104
|
end
|
105
105
|
<% end -%>
|
@@ -17,7 +17,7 @@ table.table.table-borderless.table-sm.w-auto.mb-0.m-3
|
|
17
17
|
<%- end -%>
|
18
18
|
tr
|
19
19
|
th = t('attributes.created_at')
|
20
|
-
td =
|
20
|
+
td = @<%= singular_name %>.created_at
|
21
21
|
<%- if options[:trackeo_de_usuarios] -%>
|
22
22
|
tr
|
23
23
|
th = t('attributes.actualizado_por')
|
@@ -25,14 +25,14 @@ table.table.table-borderless.table-sm.w-auto.mb-0.m-3
|
|
25
25
|
<%- end -%>
|
26
26
|
tr
|
27
27
|
th = t('attributes.updated_at')
|
28
|
-
td =
|
28
|
+
td = @<%= singular_name %>.updated_at
|
29
29
|
<%- if options[:paranoia] -%>
|
30
30
|
tr
|
31
31
|
th = t('attributes.deleted_at')
|
32
|
-
td =
|
32
|
+
td = @<%= singular_name %>.deleted_at
|
33
33
|
<%- end -%>
|
34
34
|
<%- if options[:discard] -%>
|
35
35
|
tr
|
36
36
|
th = t('attributes.discarded_at')
|
37
|
-
td =
|
37
|
+
td = @<%= singular_name %>.discarded_at
|
38
38
|
<%- end -%>
|
@@ -12,9 +12,9 @@ module Rails
|
|
12
12
|
|
13
13
|
def parse_type_and_options(type)
|
14
14
|
case type
|
15
|
-
when /(string|text|binary|integer)\{(\d+)\}/
|
15
|
+
when /(string|text|binary|integer|decimal)\{(\d+)\}/
|
16
16
|
[Regexp.last_match(1), { limit: Regexp.last_match(2).to_i }]
|
17
|
-
when /(string|text|binary|float|integer|date|datetime)\{(.+)\}/
|
17
|
+
when /(string|text|binary|float|integer|date|datetime|boolean|json|decimal)\{(.+)\}/
|
18
18
|
type = Regexp.last_match(1)
|
19
19
|
provided_options = Regexp.last_match(2).split(/[,.-]/)
|
20
20
|
options = provided_options.to_h { |opt| [opt.to_sym, true] }
|
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.0.
|
4
|
+
version: 7.0.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-02-
|
11
|
+
date: 2024-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails goodies.
|
14
14
|
email:
|
@@ -36,12 +36,25 @@ files:
|
|
36
36
|
- pg_associable/lib/pg_associable/simple_form_initializer.rb
|
37
37
|
- pg_associable/lib/tasks/pg_associable_tasks.rake
|
38
38
|
- pg_associable/spec/pg_associable/helpers_spec.rb
|
39
|
+
- pg_engine/app/admin/accounts.rb
|
40
|
+
- pg_engine/app/admin/audits.rb
|
41
|
+
- pg_engine/app/admin/dashboard.rb
|
42
|
+
- pg_engine/app/admin/user_accounts.rb
|
43
|
+
- pg_engine/app/admin/users.rb
|
44
|
+
- pg_engine/app/assets/javascripts/active_admin.js
|
45
|
+
- pg_engine/app/assets/stylesheets/active_admin.scss
|
39
46
|
- pg_engine/app/assets/stylesheets/pg_rails_b5.scss
|
47
|
+
- pg_engine/app/controllers/admin/accounts_controller.rb
|
48
|
+
- pg_engine/app/controllers/admin/user_accounts_controller.rb
|
49
|
+
- pg_engine/app/controllers/admin/users_controller.rb
|
40
50
|
- pg_engine/app/controllers/pg_engine/base_controller.rb
|
41
51
|
- pg_engine/app/controllers/pg_engine/devise_controller.rb
|
42
52
|
- pg_engine/app/controllers/pg_engine/require_sign_in.rb
|
43
53
|
- pg_engine/app/controllers/pg_engine/resource_helper.rb
|
54
|
+
- pg_engine/app/decorators/account_decorator.rb
|
44
55
|
- pg_engine/app/decorators/pg_engine/base_decorator.rb
|
56
|
+
- pg_engine/app/decorators/user_account_decorator.rb
|
57
|
+
- pg_engine/app/decorators/user_decorator.rb
|
45
58
|
- pg_engine/app/helpers/pg_engine/flash_helper.rb
|
46
59
|
- pg_engine/app/helpers/pg_engine/form_helper.rb
|
47
60
|
- pg_engine/app/helpers/pg_engine/index_helper.rb
|
@@ -51,13 +64,45 @@ files:
|
|
51
64
|
- pg_engine/app/inputs/pg_engine/fecha_input.rb
|
52
65
|
- pg_engine/app/lib/pg_engine/filtros_builder.rb
|
53
66
|
- pg_engine/app/lib/pg_form_builder.rb
|
67
|
+
- pg_engine/app/models/account.rb
|
54
68
|
- pg_engine/app/models/pg_engine/base_record.rb
|
69
|
+
- pg_engine/app/models/user.rb
|
70
|
+
- pg_engine/app/models/user_account.rb
|
71
|
+
- pg_engine/app/policies/account_policy.rb
|
55
72
|
- pg_engine/app/policies/pg_engine/application_policy.rb
|
73
|
+
- pg_engine/app/policies/user_account_policy.rb
|
74
|
+
- pg_engine/app/policies/user_policy.rb
|
75
|
+
- pg_engine/app/views/admin/accounts/_account.html.slim
|
76
|
+
- pg_engine/app/views/admin/accounts/_form.html.slim
|
77
|
+
- pg_engine/app/views/admin/accounts/edit.html.slim
|
78
|
+
- pg_engine/app/views/admin/accounts/new.html.slim
|
79
|
+
- pg_engine/app/views/admin/accounts/show.html.slim
|
80
|
+
- pg_engine/app/views/admin/user_accounts/_form.html.slim
|
81
|
+
- pg_engine/app/views/admin/user_accounts/_user_account.html.slim
|
82
|
+
- pg_engine/app/views/admin/user_accounts/edit.html.slim
|
83
|
+
- pg_engine/app/views/admin/user_accounts/new.html.slim
|
84
|
+
- pg_engine/app/views/admin/user_accounts/show.html.slim
|
85
|
+
- pg_engine/app/views/admin/users/_form.html.slim
|
86
|
+
- pg_engine/app/views/admin/users/_user.html.slim
|
87
|
+
- pg_engine/app/views/admin/users/edit.html.slim
|
88
|
+
- pg_engine/app/views/admin/users/new.html.slim
|
89
|
+
- pg_engine/app/views/admin/users/show.html.slim
|
56
90
|
- pg_engine/app/views/pg_engine/base/download.xlsx.axlsx
|
57
91
|
- pg_engine/app/views/pg_engine/base/index.html.slim
|
92
|
+
- pg_engine/config/initializers/active_admin.rb
|
93
|
+
- pg_engine/config/initializers/devise.rb
|
94
|
+
- pg_engine/config/locales/devise.en.yml
|
58
95
|
- pg_engine/config/locales/es.yml
|
96
|
+
- pg_engine/config/routes.rb
|
59
97
|
- pg_engine/config/simple_form/simple_form.rb
|
60
98
|
- pg_engine/config/simple_form/simple_form_bootstrap.rb
|
99
|
+
- pg_engine/db/migrate/20240205194218_devise_create_users.rb
|
100
|
+
- pg_engine/db/migrate/20240208234111_unaccent.rb
|
101
|
+
- pg_engine/db/migrate/20240208234901_install_audited.rb
|
102
|
+
- pg_engine/db/migrate/20240210025702_create_active_admin_comments.rb
|
103
|
+
- pg_engine/db/migrate/20240211152951_create_accounts.rb
|
104
|
+
- pg_engine/db/migrate/20240211153049_create_user_accounts.rb
|
105
|
+
- pg_engine/db/seeds.rb
|
61
106
|
- pg_engine/lib/pg_engine.rb
|
62
107
|
- pg_engine/lib/pg_engine/configuracion.rb
|
63
108
|
- pg_engine/lib/pg_engine/core_ext.rb
|
@@ -65,8 +110,15 @@ files:
|
|
65
110
|
- pg_engine/lib/pg_engine/route_helpers.rb
|
66
111
|
- pg_engine/lib/pg_engine/utils/pg_logger.rb
|
67
112
|
- pg_engine/lib/tasks/auto_anotar_modelos.rake
|
68
|
-
- pg_engine/
|
69
|
-
- pg_engine/
|
113
|
+
- pg_engine/spec/controllers/admin/accounts_controller_spec.rb
|
114
|
+
- pg_engine/spec/controllers/admin/user_accounts_controller_spec.rb
|
115
|
+
- pg_engine/spec/controllers/admin/users_controller_spec.rb
|
116
|
+
- pg_engine/spec/factories/accounts.rb
|
117
|
+
- pg_engine/spec/factories/user_accounts.rb
|
118
|
+
- pg_engine/spec/factories/users.rb
|
119
|
+
- pg_engine/spec/models/account_spec.rb
|
120
|
+
- pg_engine/spec/models/user_account_spec.rb
|
121
|
+
- pg_engine/spec/models/user_spec.rb
|
70
122
|
- pg_layout/app/assets/stylesheets/sidebar.scss
|
71
123
|
- pg_layout/app/javascript/cookies.js
|
72
124
|
- pg_layout/app/javascript/navbar_controller.js
|