pg_rails 7.0.8.pre.alpha.81 → 7.0.8.pre.alpha.82
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 +4 -4
- data/pg_engine/app/controllers/concerns/pg_engine/resource.rb +0 -1
- data/pg_engine/app/controllers/pg_engine/base_controller.rb +1 -1
- data/pg_engine/app/helpers/pg_engine/flash_helper.rb +0 -1
- data/pg_engine/app/mailers/pg_engine/base_mailer.rb +1 -3
- data/pg_engine/app/models/email.rb +5 -0
- data/pg_engine/config/initializers/active_admin.rb +1 -1
- data/pg_engine/config/locales/es.yml +1 -0
- data/pg_engine/lib/pg_engine/email_observer.rb +1 -1
- data/pg_engine/spec/controllers/concerns/pg_engine/resource_helper_spec.rb +2 -2
- data/pg_engine/spec/features/signup_spec.rb +1 -1
- data/pg_rails/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f155f16783603b8b6acd943855ce4d4996d92722235ec8eea4fe9cf82dd6efb0
|
|
4
|
+
data.tar.gz: 4403492bc1eaeecb807dd9bab487047b89681007100baf5e6758271a8967f163
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97f5a71981109ce5a8dac87ce5db0184e5c21fc906adc0863ca916e2b8868e5dc013ea46a924e42780b49e9d658faf32a8b5c34bcdf272edd549f848a4ad9918
|
|
7
|
+
data.tar.gz: 69dc1acfe7f80c080c4f0263f1904f9ceaff511da31a24e37ba5f77fa6e76fb4888af45313c7c41ab58b3fe3697cdaf46306c28c426bcac91e0badc84ad4aa69
|
|
@@ -92,7 +92,6 @@ module PgEngine
|
|
|
92
92
|
if params[:asociable]
|
|
93
93
|
format.turbo_stream do
|
|
94
94
|
render turbo_stream:
|
|
95
|
-
# rubocop:disable Rails/SkipsModelValidations
|
|
96
95
|
turbo_stream.update_all('.modal.show .pg-associable-form', <<~HTML
|
|
97
96
|
<div data-modal-target="response" data-response='#{object.decorate.to_json}'></div>
|
|
98
97
|
HTML
|
|
@@ -6,7 +6,6 @@ module PgEngine
|
|
|
6
6
|
|
|
7
7
|
def render_turbo_stream_title
|
|
8
8
|
title = [breadcrumbs.last&.name, I18n.t('app_name')].compact.join(' - ')
|
|
9
|
-
# rubocop:disable Rails/SkipsModelValidations
|
|
10
9
|
turbo_stream.update_all 'title', title
|
|
11
10
|
# rubocop:enable Rails/SkipsModelValidations
|
|
12
11
|
end
|
|
@@ -21,9 +21,7 @@ module PgEngine
|
|
|
21
21
|
|
|
22
22
|
rescue_from StandardError do |err|
|
|
23
23
|
pg_err err
|
|
24
|
-
if @email_object.present?
|
|
25
|
-
@email_object.update_columns(status: :failed, status_detail: err.to_s) # rubocop:disable Rails/SkipsModelValidations
|
|
26
|
-
end
|
|
24
|
+
@email_object.update_columns(status: :failed, status_detail: err.to_s) if @email_object.present?
|
|
27
25
|
end
|
|
28
26
|
|
|
29
27
|
protected
|
|
@@ -36,6 +36,8 @@ class Email < ApplicationRecord
|
|
|
36
36
|
include Hashid::Rails
|
|
37
37
|
audited
|
|
38
38
|
|
|
39
|
+
attr_accessor :require_body_input
|
|
40
|
+
|
|
39
41
|
has_one_attached :encoded_eml
|
|
40
42
|
|
|
41
43
|
belongs_to :associated, polymorphic: true, optional: true
|
|
@@ -61,6 +63,9 @@ class Email < ApplicationRecord
|
|
|
61
63
|
validates :from_name, length: { within: 0..80 }
|
|
62
64
|
validates :to, length: { within: 3..200 }
|
|
63
65
|
|
|
66
|
+
validates :body_input, length: { minimum: 10 }, if: -> { require_body_input }
|
|
67
|
+
validates :body_input, presence: true, if: -> { require_body_input }
|
|
68
|
+
|
|
64
69
|
validates :from_name, :subject, :to,
|
|
65
70
|
format: { with: /\A[^\n<>&]*\z/, message: 'contiene caracteres inválidos' }
|
|
66
71
|
|
|
@@ -105,7 +105,7 @@ ActiveAdmin.setup do |config|
|
|
|
105
105
|
# because, by default, user gets redirected to Dashboard. If user
|
|
106
106
|
# doesn't have access to Dashboard, he'll end up in a redirect loop.
|
|
107
107
|
# Method provided here should be defined in application_controller.rb.
|
|
108
|
-
|
|
108
|
+
config.on_unauthorized_access = :not_authorized
|
|
109
109
|
|
|
110
110
|
# == Current User
|
|
111
111
|
#
|
|
@@ -8,7 +8,7 @@ module PgEngine
|
|
|
8
8
|
status = get_status(message)
|
|
9
9
|
if message['email_object'].present?
|
|
10
10
|
email_object = message['email_object'].unparsed_value
|
|
11
|
-
email_object.update_columns(message_id:, mailer:, status:)
|
|
11
|
+
email_object.update_columns(message_id:, mailer:, status:)
|
|
12
12
|
else
|
|
13
13
|
to = [message.to].flatten.join(', ')
|
|
14
14
|
from = [message.from].flatten.join(', ')
|
|
@@ -68,8 +68,8 @@ describe PgEngine::Resource do
|
|
|
68
68
|
let(:param) { :categoria_de_cosa }
|
|
69
69
|
|
|
70
70
|
before do
|
|
71
|
-
cosa_pri.categoria_de_cosa.update_column(:nombre, 'a')
|
|
72
|
-
cosa_ult.categoria_de_cosa.update_column(:nombre, 'z')
|
|
71
|
+
cosa_pri.categoria_de_cosa.update_column(:nombre, 'a')
|
|
72
|
+
cosa_ult.categoria_de_cosa.update_column(:nombre, 'z')
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
context 'si es asc' do
|
|
@@ -23,7 +23,7 @@ describe 'Al Registrarse', :js do
|
|
|
23
23
|
fill_in 'user_password', with: 'admin123'
|
|
24
24
|
fill_in 'user_password_confirmation', with: 'admin123'
|
|
25
25
|
instance_exec('input[type=submit]', &find_scroll).click
|
|
26
|
-
expect(page).to have_text('
|
|
26
|
+
expect(page).to have_text('Te enviamos un correo electrónico con instrucciones')
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
data/pg_rails/lib/version.rb
CHANGED