pg_rails 7.0.6 → 7.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -0
  3. data/pg_associable/lib/pg_associable/engine.rb +0 -4
  4. data/pg_associable/spec/pg_associable/helpers_spec.rb +4 -3
  5. data/pg_engine/app/admin/accounts.rb +25 -0
  6. data/pg_engine/{lib/templates/activeadmin → app/admin}/audits.rb +3 -3
  7. data/pg_engine/app/admin/dashboard.rb +34 -0
  8. data/pg_engine/app/admin/user_accounts.rb +26 -0
  9. data/pg_engine/{lib/templates/activeadmin → app/admin}/users.rb +1 -2
  10. data/pg_engine/app/assets/javascripts/active_admin.js +1 -0
  11. data/pg_engine/app/assets/stylesheets/active_admin.scss +17 -0
  12. data/pg_engine/app/controllers/admin/accounts_controller.rb +33 -0
  13. data/pg_engine/app/controllers/admin/user_accounts_controller.rb +33 -0
  14. data/pg_engine/app/controllers/admin/users_controller.rb +47 -0
  15. data/pg_engine/app/controllers/pg_engine/resource_helper.rb +1 -0
  16. data/pg_engine/app/decorators/account_decorator.rb +16 -0
  17. data/pg_engine/app/decorators/user_account_decorator.rb +19 -0
  18. data/pg_engine/app/decorators/user_decorator.rb +20 -0
  19. data/pg_engine/app/helpers/pg_engine/flash_helper.rb +1 -1
  20. data/pg_engine/app/models/account.rb +39 -0
  21. data/pg_engine/app/models/user.rb +61 -0
  22. data/pg_engine/app/models/user_account.rb +46 -0
  23. data/pg_engine/app/policies/account_policy.rb +31 -0
  24. data/pg_engine/app/policies/pg_engine/application_policy.rb +1 -1
  25. data/pg_engine/app/policies/user_account_policy.rb +31 -0
  26. data/pg_engine/app/policies/user_policy.rb +31 -0
  27. data/pg_engine/app/views/admin/accounts/_account.html.slim +1 -0
  28. data/pg_engine/app/views/admin/accounts/_form.html.slim +12 -0
  29. data/pg_engine/app/views/admin/accounts/edit.html.slim +5 -0
  30. data/pg_engine/app/views/admin/accounts/new.html.slim +5 -0
  31. data/pg_engine/app/views/admin/accounts/show.html.slim +27 -0
  32. data/pg_engine/app/views/admin/user_accounts/_form.html.slim +12 -0
  33. data/pg_engine/app/views/admin/user_accounts/_user_account.html.slim +1 -0
  34. data/pg_engine/app/views/admin/user_accounts/edit.html.slim +5 -0
  35. data/pg_engine/app/views/admin/user_accounts/new.html.slim +5 -0
  36. data/pg_engine/app/views/admin/user_accounts/show.html.slim +24 -0
  37. data/pg_engine/app/views/admin/users/_form.html.slim +12 -0
  38. data/pg_engine/app/views/admin/users/_user.html.slim +1 -0
  39. data/pg_engine/app/views/admin/users/edit.html.slim +5 -0
  40. data/pg_engine/app/views/admin/users/new.html.slim +5 -0
  41. data/pg_engine/app/views/admin/users/show.html.slim +27 -0
  42. data/pg_engine/config/initializers/active_admin.rb +355 -0
  43. data/pg_engine/config/initializers/devise.rb +313 -0
  44. data/pg_engine/config/locales/devise.en.yml +65 -0
  45. data/pg_engine/config/routes.rb +11 -0
  46. data/pg_engine/db/migrate/20240205194218_devise_create_users.rb +47 -0
  47. data/pg_engine/db/migrate/20240208234111_unaccent.rb +5 -0
  48. data/pg_engine/db/migrate/20240208234901_install_audited.rb +32 -0
  49. data/pg_engine/db/migrate/20240210025702_create_active_admin_comments.rb +16 -0
  50. data/pg_engine/db/migrate/20240211152951_create_accounts.rb +24 -0
  51. data/pg_engine/db/migrate/20240211153049_create_user_accounts.rb +20 -0
  52. data/pg_engine/db/seeds.rb +5 -0
  53. data/pg_engine/lib/pg_engine/engine.rb +16 -2
  54. data/pg_engine/spec/controllers/admin/accounts_controller_spec.rb +206 -0
  55. data/pg_engine/spec/controllers/admin/user_accounts_controller_spec.rb +189 -0
  56. data/pg_engine/spec/controllers/admin/users_controller_spec.rb +180 -0
  57. data/pg_engine/spec/factories/accounts.rb +11 -0
  58. data/pg_engine/spec/factories/user_accounts.rb +21 -0
  59. data/pg_engine/spec/factories/users.rb +59 -0
  60. data/pg_engine/spec/models/account_spec.rb +13 -0
  61. data/pg_engine/spec/models/user_account_spec.rb +13 -0
  62. data/pg_engine/spec/models/user_spec.rb +13 -0
  63. data/pg_layout/lib/pg_layout/engine.rb +0 -1
  64. data/pg_rails/lib/version.rb +1 -1
  65. data/pg_scaffold/lib/generators/pg_pundit/templates/policy.rb +1 -1
  66. data/pg_scaffold/lib/generators/pg_rspec/scaffold/templates/controller_spec.rb +4 -4
  67. data/pg_scaffold/spec/generators_spec.rb +1 -1
  68. metadata +56 -4
@@ -2,6 +2,5 @@
2
2
 
3
3
  module PgLayout
4
4
  class Engine < ::Rails::Engine
5
- isolate_namespace PgLayout
6
5
  end
7
6
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.6'
4
+ VERSION = '7.0.7'
5
5
  end
@@ -31,7 +31,7 @@ class <%= class_name %>Policy < ApplicationPolicy
31
31
  # end
32
32
 
33
33
  # def acceso_total?
34
- # user.admin?
34
+ # user.developer?
35
35
  # end
36
36
  end
37
37
  <% end -%>
@@ -54,10 +54,10 @@ RSpec.describe <%= controller_class_name %>Controller do
54
54
  end
55
55
  <% end -%>
56
56
 
57
- let(:user) { create :user, :admin }
57
+ let(:logged_user) { create :user, :developer }
58
58
 
59
59
  before do
60
- sign_in user if user.present?
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(:user) { nil }
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)).to be_empty
102
+ expect(assigns(:collection)).not_to include(<%= nombre_tabla_completo_singular %>)
103
103
  end
104
104
  end
105
105
  <% end -%>
@@ -33,7 +33,7 @@ describe 'Generators' do
33
33
 
34
34
  my_assert_file 'spec/controllers/frontend/modelos_controller_spec.rb' do |content|
35
35
  assert_match(/routing/, content)
36
- assert_match(/sign_in user/, content)
36
+ assert_match(/sign_in/, content)
37
37
  end
38
38
  end
39
39
  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.0.6
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-10 00:00:00.000000000 Z
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/lib/templates/activeadmin/audits.rb
69
- - pg_engine/lib/templates/activeadmin/users.rb
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