pg_rails 7.0.8.pre.alpha.81 → 7.0.8.pre.alpha.82

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: 3c5e3d8a7a2e5ca208148f212006a872999b6869a27927044fc4363d14643bd4
4
- data.tar.gz: 6011e300a9353d344253e7404929d207688e7b5337578931d538522c2c19b77f
3
+ metadata.gz: f155f16783603b8b6acd943855ce4d4996d92722235ec8eea4fe9cf82dd6efb0
4
+ data.tar.gz: 4403492bc1eaeecb807dd9bab487047b89681007100baf5e6758271a8967f163
5
5
  SHA512:
6
- metadata.gz: 8694882667b710bc7e4bbde02cb1bbbcf6a6a4e0202760a4fd09a866bc7ce4925e901f5f577a45d61a4f1f7b7eb67e012cdb6920730bb385e55052596bceae63
7
- data.tar.gz: b93fd84594a60f5473bcd180af88485a646e8c62e2bb210b75f68c4c59905aad3cf689ad9078a90798c9a6e13b047f47b677f73b2c8c12a113ed30b97a11cec2
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
@@ -91,7 +91,7 @@ module PgEngine
91
91
 
92
92
  protected
93
93
 
94
- def not_authorized
94
+ def not_authorized(_arg_required_for_active_admin)
95
95
  respond_to do |format|
96
96
  format.json do
97
97
  render json: { error: 'Acceso no autorizado' },
@@ -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
- # config.on_unauthorized_access = :access_denied
108
+ config.on_unauthorized_access = :not_authorized
109
109
 
110
110
  # == Current User
111
111
  #
@@ -65,6 +65,7 @@ es:
65
65
  timeout: ''
66
66
  unauthenticated: ''
67
67
  registrations:
68
+ signed_up_but_unconfirmed: Te enviamos un correo electrónico con instrucciones para confirmar tu cuenta.
68
69
  new:
69
70
  sign_up: Crear una cuenta
70
71
  passwords:
@@ -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:) # rubocop:disable Rails/SkipsModelValidations
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') # rubocop:disable Rails/SkipsModelValidations
72
- cosa_ult.categoria_de_cosa.update_column(:nombre, 'z') # rubocop:disable Rails/SkipsModelValidations
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('Se ha enviado un mensaje con un enlace')
26
+ expect(page).to have_text('Te enviamos un correo electrónico con instrucciones')
27
27
  end
28
28
  end
29
29
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.81'
4
+ VERSION = '7.0.8-alpha.82'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.8.pre.alpha.81
4
+ version: 7.0.8.pre.alpha.82
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso