pg_rails 7.0.8.pre.alpha.56 → 7.0.8.pre.alpha.57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_engine/app/admin/audits.rb +2 -0
- data/pg_engine/app/admin/emails.rb +22 -0
- data/pg_engine/app/controllers/admin/emails_controller.rb +41 -0
- data/pg_engine/app/decorators/email_decorator.rb +20 -0
- data/pg_engine/app/mailers/pg_engine/base_mailer.rb +34 -0
- data/pg_engine/app/models/email.rb +81 -0
- data/pg_engine/app/policies/email_policy.rb +35 -0
- data/pg_engine/app/views/admin/emails/_form.html.slim +16 -0
- data/pg_engine/app/views/admin/emails/show.html.slim +29 -0
- data/pg_engine/config/initializers/action_mailer.rb +2 -0
- data/pg_engine/config/routes.rb +214 -0
- data/pg_engine/db/migrate/20240506194106_create_emails.rb +35 -0
- data/pg_engine/lib/pg_engine/email_observer.rb +66 -0
- data/pg_engine/lib/pg_engine/mailgun/log_sync.rb +71 -0
- data/pg_engine/lib/pg_engine.rb +4 -0
- data/pg_engine/spec/controllers/admin/emails_controller_spec.rb +216 -0
- data/pg_engine/spec/controllers/admin/users_controller_spec.rb +3 -3
- data/pg_engine/spec/factories/emails.rb +29 -0
- data/pg_engine/spec/lib/pg_engine/mailgun/log_sync_spec.rb +25 -0
- data/pg_engine/spec/models/email_spec.rb +13 -0
- data/pg_layout/app/views/layouts/pg_layout/mailer.html.slim +11 -0
- data/pg_layout/app/views/layouts/pg_layout/mailer.text.slim +4 -0
- data/pg_rails/lib/pg_rails/redis_support.rb +6 -0
- data/pg_rails/lib/version.rb +1 -1
- data/pg_scaffold/lib/generators/pg_rspec/scaffold/templates/controller_spec.rb +2 -2
- metadata +76 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49e6cb9913064fd946d0ed5100572a31e6e39b7b4c0c5efeb8ca8ca520d9e75b
|
4
|
+
data.tar.gz: 206b926af17474e1ce20b6d76724729b60a6ee10955b3b459191949d72bcd3ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66dd233f281b67cf4557acdcc839095b6cf4327972f2bde48544a025fadf8ad272b5e6b15aea8fc000e7a8d4cb2dec37af3512d5326d23cf774dfef172a38147
|
7
|
+
data.tar.gz: '091b62e7722d9bdabb8df428074ac5f4a796cb1c2a4b058a86c6fd235a88b11dc160b1b30a5b34bd3f807a533c0c7337d61b8d92327028843c2ec1a2f8fd313a'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
ActiveAdmin.register Email do
|
2
|
+
actions :index, :show
|
3
|
+
index do
|
4
|
+
selectable_column
|
5
|
+
id_column
|
6
|
+
column :from_address
|
7
|
+
column :to
|
8
|
+
column :subject
|
9
|
+
column :body_input
|
10
|
+
column :tags
|
11
|
+
column :associated
|
12
|
+
column :status
|
13
|
+
actions
|
14
|
+
end
|
15
|
+
|
16
|
+
filter :from_address
|
17
|
+
filter :to
|
18
|
+
filter :tags
|
19
|
+
filter :message_id
|
20
|
+
filter :mailer
|
21
|
+
filter :status
|
22
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# generado con pg_rails
|
4
|
+
|
5
|
+
module Admin
|
6
|
+
class EmailsController < AdminController
|
7
|
+
include PgEngine::Resource
|
8
|
+
|
9
|
+
before_action { @clase_modelo = Email }
|
10
|
+
|
11
|
+
before_action(only: :index) { authorize Email }
|
12
|
+
|
13
|
+
before_action :set_instancia_modelo, only: %i[new create show edit update destroy content_eml]
|
14
|
+
|
15
|
+
add_breadcrumb Email.nombre_plural, :admin_emails_path
|
16
|
+
|
17
|
+
def content_eml
|
18
|
+
send_data @email.content_eml, filename: "email_#{@email.id}.txt", disposition: :inline
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def atributos_permitidos
|
24
|
+
%i[from_address from_name reply_to to subject body_input associated_id associated_type]
|
25
|
+
end
|
26
|
+
|
27
|
+
def atributos_para_buscar
|
28
|
+
%i[accepted_at delivered_at opened_at from_address from_name reply_to to subject body_input tags content_eml
|
29
|
+
message_id mailer status_detail status]
|
30
|
+
end
|
31
|
+
|
32
|
+
def atributos_para_listar
|
33
|
+
%i[from_address to subject body_input tags associated status]
|
34
|
+
end
|
35
|
+
|
36
|
+
def atributos_para_mostrar
|
37
|
+
%i[message_id status status_detail accepted_at delivered_at opened_at from_address
|
38
|
+
from_name reply_to to subject body_input tags associated mailer content_eml_link]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# generado con pg_rails
|
4
|
+
|
5
|
+
class EmailDecorator < PgEngine::BaseDecorator
|
6
|
+
delegate_all
|
7
|
+
|
8
|
+
# Define presentation-specific methods here. Helpers are accessed through
|
9
|
+
# `helpers` (aka `h`). You can override attributes, for example:
|
10
|
+
#
|
11
|
+
# def created_at
|
12
|
+
# helpers.content_tag :span, class: 'time' do
|
13
|
+
# object.created_at.strftime("%a %m/%d/%y")
|
14
|
+
# end
|
15
|
+
# end
|
16
|
+
|
17
|
+
def content_eml_link
|
18
|
+
link_to 'Download', helpers.content_eml_admin_email_path(object), target: :_blank, rel: :noopener
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module PgEngine
|
2
|
+
class BaseMailer < ActionMailer::Base # rubocop:disable Rails/ApplicationMailer
|
3
|
+
class MailNotDelivered < StandardError; end
|
4
|
+
|
5
|
+
before_action { @email = params[:email] }
|
6
|
+
|
7
|
+
default from: -> { email_address_with_name(@email.from_address, @email.from_name) },
|
8
|
+
reply_to: -> { @email.reply_to },
|
9
|
+
subject: -> { @email.subject },
|
10
|
+
to: -> { @email.to }
|
11
|
+
|
12
|
+
layout 'pg_layout/mailer'
|
13
|
+
|
14
|
+
rescue_from MailNotDelivered do |err|
|
15
|
+
# FIXME: marcar el Email en la DB como fallido
|
16
|
+
pg_err err
|
17
|
+
end
|
18
|
+
|
19
|
+
def mail
|
20
|
+
super.tap do |message|
|
21
|
+
# message.mailgun_options = {
|
22
|
+
# 'tag' => email.tags,
|
23
|
+
# 'tracking-opens' => true
|
24
|
+
# }
|
25
|
+
message['email'] = @email
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# # TODO: testear
|
32
|
+
# si from está vacío
|
33
|
+
# si body está vacío
|
34
|
+
# si se lanza PgEngine::BaseMailer::MailNotDelivered
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# == Schema Information
|
4
|
+
#
|
5
|
+
# Table name: emails
|
6
|
+
#
|
7
|
+
# id :bigint not null, primary key
|
8
|
+
# accepted_at :datetime
|
9
|
+
# associated_type :string indexed => [associated_id]
|
10
|
+
# body_input :string
|
11
|
+
# content_eml :string
|
12
|
+
# delivered_at :datetime
|
13
|
+
# from_address :string not null
|
14
|
+
# from_name :string
|
15
|
+
# mailer :string
|
16
|
+
# opened_at :datetime
|
17
|
+
# reply_to :string
|
18
|
+
# status :integer default(0), not null
|
19
|
+
# status_detail :string
|
20
|
+
# subject :string
|
21
|
+
# tags :string is an Array
|
22
|
+
# to :string not null
|
23
|
+
# created_at :datetime not null
|
24
|
+
# updated_at :datetime not null
|
25
|
+
# actualizado_por_id :bigint indexed
|
26
|
+
# associated_id :bigint indexed => [associated_type]
|
27
|
+
# creado_por_id :bigint indexed
|
28
|
+
# message_id :string
|
29
|
+
#
|
30
|
+
# Foreign Keys
|
31
|
+
#
|
32
|
+
# fk_rails_... (actualizado_por_id => users.id)
|
33
|
+
# fk_rails_... (creado_por_id => users.id)
|
34
|
+
#
|
35
|
+
# generado con pg_rails
|
36
|
+
|
37
|
+
class Email < ApplicationRecord
|
38
|
+
audited
|
39
|
+
|
40
|
+
belongs_to :associated, polymorphic: true, optional: true
|
41
|
+
|
42
|
+
belongs_to :creado_por, optional: true, class_name: 'User'
|
43
|
+
belongs_to :actualizado_por, optional: true, class_name: 'User'
|
44
|
+
|
45
|
+
kredis_unique_list :logs
|
46
|
+
|
47
|
+
# TODO: y el fallido temporario?
|
48
|
+
enumerize :status, in: { pending: 0, blocked: 1, sent: 2, accepted: 3, delivered: 4, rejected: 5 }
|
49
|
+
|
50
|
+
validates :from_address, :to, :status, presence: true
|
51
|
+
|
52
|
+
validate do
|
53
|
+
if to.present? && !to.split(/[,;]/).all? { |dest| dest.match(/\A[^@\s]+@[^@\s]+\z/) }
|
54
|
+
# FIXME: testear
|
55
|
+
errors.add(:to, 'no es válido')
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
validates :subject, length: { within: 0..200 }
|
60
|
+
validates :from_name, length: { within: 0..80 }
|
61
|
+
validates :to, length: { within: 3..200 }
|
62
|
+
|
63
|
+
validates :from_name, :subject, :to,
|
64
|
+
format: { with: /\A[^\n<>&]*\z/, message: 'contiene caracteres inválidos' }
|
65
|
+
|
66
|
+
after_initialize do
|
67
|
+
self.from_address = ENV.fetch('DEFAULT_MAIL_FROM') if from_address.blank?
|
68
|
+
end
|
69
|
+
# validates_format_of :subject, with: /\A[[[:alpha:]]\(\)\w\s.,;!¡?¿-]+\z/
|
70
|
+
# def strip_all(input)
|
71
|
+
# return if input.blank?
|
72
|
+
|
73
|
+
# strip_tags(input.strip)
|
74
|
+
# end
|
75
|
+
|
76
|
+
# def convert_br(input)
|
77
|
+
# return if input.blank?
|
78
|
+
|
79
|
+
# input.gsub("\n", '<br>').html_safe
|
80
|
+
# end
|
81
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# generado con pg_rails
|
4
|
+
|
5
|
+
class EmailPolicy < ApplicationPolicy
|
6
|
+
class Scope < ApplicationPolicy::Scope
|
7
|
+
# def resolve
|
8
|
+
# if policy.acceso_total?
|
9
|
+
# scope.all
|
10
|
+
# else
|
11
|
+
# scope.none
|
12
|
+
# end
|
13
|
+
# end
|
14
|
+
end
|
15
|
+
|
16
|
+
# def puede_editar?
|
17
|
+
# acceso_total? && !record.readonly?
|
18
|
+
# end
|
19
|
+
|
20
|
+
# def puede_crear?
|
21
|
+
# acceso_total? || user.asesor?
|
22
|
+
# end
|
23
|
+
|
24
|
+
# def puede_borrar?
|
25
|
+
# acceso_total? && !record.readonly?
|
26
|
+
# end
|
27
|
+
|
28
|
+
# def acceso_total?
|
29
|
+
# user.developer?
|
30
|
+
# end
|
31
|
+
|
32
|
+
def content_eml?
|
33
|
+
acceso_total?
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/ # locals: (object: nil, asociable: false)
|
2
|
+
|
3
|
+
div style="max-width: 22em" data-controller="pg_form"
|
4
|
+
= pg_form_for(@email || object, asociable:) do |f|
|
5
|
+
= f.mensajes_de_error
|
6
|
+
|
7
|
+
= hidden_field_tag :asociable, true if asociable
|
8
|
+
= f.input :from_address
|
9
|
+
= f.input :from_name
|
10
|
+
= f.input :reply_to
|
11
|
+
= f.input :to
|
12
|
+
= f.input :subject
|
13
|
+
= f.input :body_input, as: :text
|
14
|
+
|
15
|
+
.mt-2
|
16
|
+
= f.button :submit
|
@@ -0,0 +1,29 @@
|
|
1
|
+
- content_for :title do
|
2
|
+
= @email.to_s
|
3
|
+
- content_for :actions do
|
4
|
+
= @email.destroy_link_redirect
|
5
|
+
.ms-1
|
6
|
+
= @email.edit_link
|
7
|
+
|
8
|
+
table.table.table-borderless.table-sm.w-auto.mb-0.m-3
|
9
|
+
- atributos_para_mostrar.each do |att|
|
10
|
+
tr
|
11
|
+
th = @clase_modelo.human_attribute_name(att)
|
12
|
+
td = @email.send(att)
|
13
|
+
tr
|
14
|
+
th = t('attributes.creado_por')
|
15
|
+
td = @email.creado_por
|
16
|
+
tr
|
17
|
+
th = t('attributes.created_at')
|
18
|
+
td = @email.created_at
|
19
|
+
tr
|
20
|
+
th = t('attributes.actualizado_por')
|
21
|
+
td = @email.actualizado_por
|
22
|
+
tr
|
23
|
+
th = t('attributes.updated_at')
|
24
|
+
td = @email.updated_at
|
25
|
+
|
26
|
+
h4 Logs
|
27
|
+
- @email.logs.to_a.each do |log|
|
28
|
+
- json = JSON.parse(log)
|
29
|
+
p = json['event']
|
data/pg_engine/config/routes.rb
CHANGED
@@ -9,6 +9,11 @@ Rails.application.routes.draw do
|
|
9
9
|
registrations: 'users/registrations'
|
10
10
|
}
|
11
11
|
namespace :admin, path: 'a' do
|
12
|
+
pg_resource(:emails) do
|
13
|
+
member do
|
14
|
+
get :content_eml
|
15
|
+
end
|
16
|
+
end
|
12
17
|
pg_resource(:users)
|
13
18
|
pg_resource(:accounts)
|
14
19
|
pg_resource(:user_accounts)
|
@@ -16,3 +21,212 @@ Rails.application.routes.draw do
|
|
16
21
|
end
|
17
22
|
ActiveAdmin.routes(self)
|
18
23
|
end
|
24
|
+
|
25
|
+
# Prefix Verb URI Pattern Controller#Action
|
26
|
+
# abrir_modal_frontend_cosas GET /frontend/cosas/abrir_modal(.:format) frontend/cosas#abrir_modal
|
27
|
+
# buscar_frontend_cosas POST /frontend/cosas/buscar(.:format) frontend/cosas#buscar
|
28
|
+
# frontend_cosas GET /frontend/cosas(.:format) frontend/cosas#index
|
29
|
+
# POST /frontend/cosas(.:format) frontend/cosas#create
|
30
|
+
# new_frontend_cosa GET /frontend/cosas/new(.:format) frontend/cosas#new
|
31
|
+
# edit_frontend_cosa GET /frontend/cosas/:id/edit(.:format) frontend/cosas#edit
|
32
|
+
# frontend_cosa GET /frontend/cosas/:id(.:format) frontend/cosas#show
|
33
|
+
# PATCH /frontend/cosas/:id(.:format) frontend/cosas#update
|
34
|
+
# PUT /frontend/cosas/:id(.:format) frontend/cosas#update
|
35
|
+
# DELETE /frontend/cosas/:id(.:format) frontend/cosas#destroy
|
36
|
+
# abrir_modal_frontend_categoria_de_cosas GET /frontend/categoria_de_cosas/abrir_modal(.:format) frontend/categoria_de_cosas#abrir_modal
|
37
|
+
# buscar_frontend_categoria_de_cosas POST /frontend/categoria_de_cosas/buscar(.:format) frontend/categoria_de_cosas#buscar
|
38
|
+
# frontend_categoria_de_cosas GET /frontend/categoria_de_cosas(.:format) frontend/categoria_de_cosas#index
|
39
|
+
# POST /frontend/categoria_de_cosas(.:format) frontend/categoria_de_cosas#create
|
40
|
+
# new_frontend_categoria_de_cosa GET /frontend/categoria_de_cosas/new(.:format) frontend/categoria_de_cosas#new
|
41
|
+
# edit_frontend_categoria_de_cosa GET /frontend/categoria_de_cosas/:id/edit(.:format) frontend/categoria_de_cosas#edit
|
42
|
+
# frontend_categoria_de_cosa GET /frontend/categoria_de_cosas/:id(.:format) frontend/categoria_de_cosas#show
|
43
|
+
# PATCH /frontend/categoria_de_cosas/:id(.:format) frontend/categoria_de_cosas#update
|
44
|
+
# PUT /frontend/categoria_de_cosas/:id(.:format) frontend/categoria_de_cosas#update
|
45
|
+
# DELETE /frontend/categoria_de_cosas/:id(.:format) frontend/categoria_de_cosas#destroy
|
46
|
+
# abrir_modal_admin_cosas GET /admin/cosas/abrir_modal(.:format) admin/cosas#abrir_modal
|
47
|
+
# buscar_admin_cosas POST /admin/cosas/buscar(.:format) admin/cosas#buscar
|
48
|
+
# admin_cosas GET /admin/cosas(.:format) admin/cosas#index
|
49
|
+
# POST /admin/cosas(.:format) admin/cosas#create
|
50
|
+
# new_admin_cosa GET /admin/cosas/new(.:format) admin/cosas#new
|
51
|
+
# edit_admin_cosa GET /admin/cosas/:id/edit(.:format) admin/cosas#edit
|
52
|
+
# admin_cosa GET /admin/cosas/:id(.:format) admin/cosas#show
|
53
|
+
# PATCH /admin/cosas/:id(.:format) admin/cosas#update
|
54
|
+
# PUT /admin/cosas/:id(.:format) admin/cosas#update
|
55
|
+
# DELETE /admin/cosas/:id(.:format) admin/cosas#destroy
|
56
|
+
# abrir_modal_admin_categoria_de_cosas GET /admin/categoria_de_cosas/abrir_modal(.:format) admin/categoria_de_cosas#abrir_modal
|
57
|
+
# buscar_admin_categoria_de_cosas POST /admin/categoria_de_cosas/buscar(.:format) admin/categoria_de_cosas#buscar
|
58
|
+
# admin_categoria_de_cosas GET /admin/categoria_de_cosas(.:format) admin/categoria_de_cosas#index
|
59
|
+
# POST /admin/categoria_de_cosas(.:format) admin/categoria_de_cosas#create
|
60
|
+
# new_admin_categoria_de_cosa GET /admin/categoria_de_cosas/new(.:format) admin/categoria_de_cosas#new
|
61
|
+
# edit_admin_categoria_de_cosa GET /admin/categoria_de_cosas/:id/edit(.:format) admin/categoria_de_cosas#edit
|
62
|
+
# admin_categoria_de_cosa GET /admin/categoria_de_cosas/:id(.:format) admin/categoria_de_cosas#show
|
63
|
+
# PATCH /admin/categoria_de_cosas/:id(.:format) admin/categoria_de_cosas#update
|
64
|
+
# PUT /admin/categoria_de_cosas/:id(.:format) admin/categoria_de_cosas#update
|
65
|
+
# DELETE /admin/categoria_de_cosas/:id(.:format) admin/categoria_de_cosas#destroy
|
66
|
+
# root GET / admin/categoria_de_cosas#index
|
67
|
+
# action_with_redirect GET /action_with_redirect(.:format) dummy_base#action_with_redirect
|
68
|
+
# check_dev_user GET /check_dev_user(.:format) dummy_base#check_dev_user
|
69
|
+
# test_not_authorized GET /test_not_authorized(.:format) dummy_base#test_not_authorized
|
70
|
+
# test_internal_error GET /test_internal_error(.:format) dummy_base#test_internal_error
|
71
|
+
# turbo_recede_historical_location GET /recede_historical_location(.:format) turbo/native/navigation#recede
|
72
|
+
# turbo_resume_historical_location GET /resume_historical_location(.:format) turbo/native/navigation#resume
|
73
|
+
# turbo_refresh_historical_location GET /refresh_historical_location(.:format) turbo/native/navigation#refresh
|
74
|
+
# abrir_modal_public_mensaje_contactos GET /contacto/abrir_modal(.:format) public/mensaje_contactos#abrir_modal
|
75
|
+
# buscar_public_mensaje_contactos POST /contacto/buscar(.:format) public/mensaje_contactos#buscar
|
76
|
+
# public_mensaje_contactos POST /contacto(.:format) public/mensaje_contactos#create
|
77
|
+
# new_public_mensaje_contacto GET /contacto/new(.:format) public/mensaje_contactos#new
|
78
|
+
# new_user_session GET /users/sign_in(.:format) devise/sessions#new
|
79
|
+
# user_session POST /users/sign_in(.:format) devise/sessions#create
|
80
|
+
# destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
|
81
|
+
# new_user_password GET /users/password/new(.:format) devise/passwords#new
|
82
|
+
# edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
|
83
|
+
# user_password PATCH /users/password(.:format) devise/passwords#update
|
84
|
+
# PUT /users/password(.:format) devise/passwords#update
|
85
|
+
# POST /users/password(.:format) devise/passwords#create
|
86
|
+
# cancel_user_registration GET /users/cancel(.:format) users/registrations#cancel
|
87
|
+
# new_user_registration GET /users/sign_up(.:format) users/registrations#new
|
88
|
+
# edit_user_registration GET /users/edit(.:format) users/registrations#edit
|
89
|
+
# user_registration PATCH /users(.:format) users/registrations#update
|
90
|
+
# PUT /users(.:format) users/registrations#update
|
91
|
+
# DELETE /users(.:format) users/registrations#destroy
|
92
|
+
# POST /users(.:format) users/registrations#create
|
93
|
+
# new_user_confirmation GET /users/confirmation/new(.:format) users/confirmations#new
|
94
|
+
# user_confirmation GET /users/confirmation(.:format) users/confirmations#show
|
95
|
+
# POST /users/confirmation(.:format) users/confirmations#create
|
96
|
+
# new_user_unlock GET /users/unlock/new(.:format) devise/unlocks#new
|
97
|
+
# user_unlock GET /users/unlock(.:format) devise/unlocks#show
|
98
|
+
# POST /users/unlock(.:format) devise/unlocks#create
|
99
|
+
# abrir_modal_admin_emails GET /a/emails/abrir_modal(.:format) admin/emails#abrir_modal
|
100
|
+
# buscar_admin_emails POST /a/emails/buscar(.:format) admin/emails#buscar
|
101
|
+
# content_eml_admin_email GET /a/emails/:id/content_eml(.:format) admin/emails#content_eml
|
102
|
+
# admin_emails GET /a/emails(.:format) admin/emails#index
|
103
|
+
# POST /a/emails(.:format) admin/emails#create
|
104
|
+
# new_admin_email GET /a/emails/new(.:format) admin/emails#new
|
105
|
+
# edit_admin_email GET /a/emails/:id/edit(.:format) admin/emails#edit
|
106
|
+
# admin_email GET /a/emails/:id(.:format) admin/emails#show
|
107
|
+
# PATCH /a/emails/:id(.:format) admin/emails#update
|
108
|
+
# PUT /a/emails/:id(.:format) admin/emails#update
|
109
|
+
# DELETE /a/emails/:id(.:format) admin/emails#destroy
|
110
|
+
# abrir_modal_admin_users GET /a/users/abrir_modal(.:format) admin/users#abrir_modal
|
111
|
+
# buscar_admin_users POST /a/users/buscar(.:format) admin/users#buscar
|
112
|
+
# admin_users GET /a/users(.:format) admin/users#index
|
113
|
+
# POST /a/users(.:format) admin/users#create
|
114
|
+
# new_admin_user GET /a/users/new(.:format) admin/users#new
|
115
|
+
# edit_admin_user GET /a/users/:id/edit(.:format) admin/users#edit
|
116
|
+
# admin_user GET /a/users/:id(.:format) admin/users#show
|
117
|
+
# PATCH /a/users/:id(.:format) admin/users#update
|
118
|
+
# PUT /a/users/:id(.:format) admin/users#update
|
119
|
+
# DELETE /a/users/:id(.:format) admin/users#destroy
|
120
|
+
# abrir_modal_admin_accounts GET /a/accounts/abrir_modal(.:format) admin/accounts#abrir_modal
|
121
|
+
# buscar_admin_accounts POST /a/accounts/buscar(.:format) admin/accounts#buscar
|
122
|
+
# admin_accounts GET /a/accounts(.:format) admin/accounts#index
|
123
|
+
# POST /a/accounts(.:format) admin/accounts#create
|
124
|
+
# new_admin_account GET /a/accounts/new(.:format) admin/accounts#new
|
125
|
+
# edit_admin_account GET /a/accounts/:id/edit(.:format) admin/accounts#edit
|
126
|
+
# admin_account GET /a/accounts/:id(.:format) admin/accounts#show
|
127
|
+
# PATCH /a/accounts/:id(.:format) admin/accounts#update
|
128
|
+
# PUT /a/accounts/:id(.:format) admin/accounts#update
|
129
|
+
# DELETE /a/accounts/:id(.:format) admin/accounts#destroy
|
130
|
+
# abrir_modal_admin_user_accounts GET /a/user_accounts/abrir_modal(.:format) admin/user_accounts#abrir_modal
|
131
|
+
# buscar_admin_user_accounts POST /a/user_accounts/buscar(.:format) admin/user_accounts#buscar
|
132
|
+
# admin_user_accounts GET /a/user_accounts(.:format) admin/user_accounts#index
|
133
|
+
# POST /a/user_accounts(.:format) admin/user_accounts#create
|
134
|
+
# new_admin_user_account GET /a/user_accounts/new(.:format) admin/user_accounts#new
|
135
|
+
# edit_admin_user_account GET /a/user_accounts/:id/edit(.:format) admin/user_accounts#edit
|
136
|
+
# admin_user_account GET /a/user_accounts/:id(.:format) admin/user_accounts#show
|
137
|
+
# PATCH /a/user_accounts/:id(.:format) admin/user_accounts#update
|
138
|
+
# PUT /a/user_accounts/:id(.:format) admin/user_accounts#update
|
139
|
+
# DELETE /a/user_accounts/:id(.:format) admin/user_accounts#destroy
|
140
|
+
# admin_login_as GET /a/login_as(.:format) admin/users#login_as
|
141
|
+
# active_admin_root GET /active_admin(.:format) active_admin/dashboard#index
|
142
|
+
# batch_action_active_admin_categoria_de_cosas POST /active_admin/categoria_de_cosas/batch_action(.:format) active_admin/categoria_de_cosas#batch_action
|
143
|
+
# active_admin_categoria_de_cosas GET /active_admin/categoria_de_cosas(.:format) active_admin/categoria_de_cosas#index
|
144
|
+
# POST /active_admin/categoria_de_cosas(.:format) active_admin/categoria_de_cosas#create
|
145
|
+
# new_active_admin_categoria_de_cosa GET /active_admin/categoria_de_cosas/new(.:format) active_admin/categoria_de_cosas#new
|
146
|
+
# edit_active_admin_categoria_de_cosa GET /active_admin/categoria_de_cosas/:id/edit(.:format) active_admin/categoria_de_cosas#edit
|
147
|
+
# active_admin_categoria_de_cosa GET /active_admin/categoria_de_cosas/:id(.:format) active_admin/categoria_de_cosas#show
|
148
|
+
# PATCH /active_admin/categoria_de_cosas/:id(.:format) active_admin/categoria_de_cosas#update
|
149
|
+
# PUT /active_admin/categoria_de_cosas/:id(.:format) active_admin/categoria_de_cosas#update
|
150
|
+
# DELETE /active_admin/categoria_de_cosas/:id(.:format) active_admin/categoria_de_cosas#destroy
|
151
|
+
# batch_action_active_admin_cosas POST /active_admin/cosas/batch_action(.:format) active_admin/cosas#batch_action
|
152
|
+
# active_admin_cosas GET /active_admin/cosas(.:format) active_admin/cosas#index
|
153
|
+
# POST /active_admin/cosas(.:format) active_admin/cosas#create
|
154
|
+
# new_active_admin_cosa GET /active_admin/cosas/new(.:format) active_admin/cosas#new
|
155
|
+
# edit_active_admin_cosa GET /active_admin/cosas/:id/edit(.:format) active_admin/cosas#edit
|
156
|
+
# active_admin_cosa GET /active_admin/cosas/:id(.:format) active_admin/cosas#show
|
157
|
+
# PATCH /active_admin/cosas/:id(.:format) active_admin/cosas#update
|
158
|
+
# PUT /active_admin/cosas/:id(.:format) active_admin/cosas#update
|
159
|
+
# DELETE /active_admin/cosas/:id(.:format) active_admin/cosas#destroy
|
160
|
+
# batch_action_active_admin_accounts POST /active_admin/accounts/batch_action(.:format) active_admin/accounts#batch_action
|
161
|
+
# active_admin_accounts GET /active_admin/accounts(.:format) active_admin/accounts#index
|
162
|
+
# POST /active_admin/accounts(.:format) active_admin/accounts#create
|
163
|
+
# new_active_admin_account GET /active_admin/accounts/new(.:format) active_admin/accounts#new
|
164
|
+
# edit_active_admin_account GET /active_admin/accounts/:id/edit(.:format) active_admin/accounts#edit
|
165
|
+
# active_admin_account GET /active_admin/accounts/:id(.:format) active_admin/accounts#show
|
166
|
+
# PATCH /active_admin/accounts/:id(.:format) active_admin/accounts#update
|
167
|
+
# PUT /active_admin/accounts/:id(.:format) active_admin/accounts#update
|
168
|
+
# DELETE /active_admin/accounts/:id(.:format) active_admin/accounts#destroy
|
169
|
+
# batch_action_active_admin_audited_audits POST /active_admin/audited_audits/batch_action(.:format) active_admin/audited_audits#batch_action
|
170
|
+
# active_admin_audited_audits GET /active_admin/audited_audits(.:format) active_admin/audited_audits#index
|
171
|
+
# active_admin_audited_audit GET /active_admin/audited_audits/:id(.:format) active_admin/audited_audits#show
|
172
|
+
# active_admin_dashboard GET /active_admin/dashboard(.:format) active_admin/dashboard#index
|
173
|
+
# batch_action_active_admin_emails POST /active_admin/emails/batch_action(.:format) active_admin/emails#batch_action
|
174
|
+
# active_admin_emails GET /active_admin/emails(.:format) active_admin/emails#index
|
175
|
+
# active_admin_email GET /active_admin/emails/:id(.:format) active_admin/emails#show
|
176
|
+
# batch_action_active_admin_mensaje_contactos POST /active_admin/mensaje_contactos/batch_action(.:format) active_admin/mensaje_contactos#batch_action
|
177
|
+
# active_admin_mensaje_contactos GET /active_admin/mensaje_contactos(.:format) active_admin/mensaje_contactos#index
|
178
|
+
# POST /active_admin/mensaje_contactos(.:format) active_admin/mensaje_contactos#create
|
179
|
+
# new_active_admin_mensaje_contacto GET /active_admin/mensaje_contactos/new(.:format) active_admin/mensaje_contactos#new
|
180
|
+
# edit_active_admin_mensaje_contacto GET /active_admin/mensaje_contactos/:id/edit(.:format) active_admin/mensaje_contactos#edit
|
181
|
+
# active_admin_mensaje_contacto GET /active_admin/mensaje_contactos/:id(.:format) active_admin/mensaje_contactos#show
|
182
|
+
# PATCH /active_admin/mensaje_contactos/:id(.:format) active_admin/mensaje_contactos#update
|
183
|
+
# PUT /active_admin/mensaje_contactos/:id(.:format) active_admin/mensaje_contactos#update
|
184
|
+
# DELETE /active_admin/mensaje_contactos/:id(.:format) active_admin/mensaje_contactos#destroy
|
185
|
+
# batch_action_active_admin_user_accounts POST /active_admin/user_accounts/batch_action(.:format) active_admin/user_accounts#batch_action
|
186
|
+
# active_admin_user_accounts GET /active_admin/user_accounts(.:format) active_admin/user_accounts#index
|
187
|
+
# POST /active_admin/user_accounts(.:format) active_admin/user_accounts#create
|
188
|
+
# new_active_admin_user_account GET /active_admin/user_accounts/new(.:format) active_admin/user_accounts#new
|
189
|
+
# edit_active_admin_user_account GET /active_admin/user_accounts/:id/edit(.:format) active_admin/user_accounts#edit
|
190
|
+
# active_admin_user_account GET /active_admin/user_accounts/:id(.:format) active_admin/user_accounts#show
|
191
|
+
# PATCH /active_admin/user_accounts/:id(.:format) active_admin/user_accounts#update
|
192
|
+
# PUT /active_admin/user_accounts/:id(.:format) active_admin/user_accounts#update
|
193
|
+
# DELETE /active_admin/user_accounts/:id(.:format) active_admin/user_accounts#destroy
|
194
|
+
# confirm_active_admin_user PUT /active_admin/users/:id/confirm(.:format) active_admin/users#confirm
|
195
|
+
# discard_active_admin_user PUT /active_admin/users/:id/discard(.:format) active_admin/users#discard
|
196
|
+
# restore_active_admin_user PUT /active_admin/users/:id/restore(.:format) active_admin/users#restore
|
197
|
+
# batch_action_active_admin_users POST /active_admin/users/batch_action(.:format) active_admin/users#batch_action
|
198
|
+
# active_admin_users GET /active_admin/users(.:format) active_admin/users#index
|
199
|
+
# POST /active_admin/users(.:format) active_admin/users#create
|
200
|
+
# new_active_admin_user GET /active_admin/users/new(.:format) active_admin/users#new
|
201
|
+
# edit_active_admin_user GET /active_admin/users/:id/edit(.:format) active_admin/users#edit
|
202
|
+
# active_admin_user GET /active_admin/users/:id(.:format) active_admin/users#show
|
203
|
+
# PATCH /active_admin/users/:id(.:format) active_admin/users#update
|
204
|
+
# PUT /active_admin/users/:id(.:format) active_admin/users#update
|
205
|
+
# DELETE /active_admin/users/:id(.:format) active_admin/users#destroy
|
206
|
+
# active_admin_comments GET /active_admin/comments(.:format) active_admin/comments#index
|
207
|
+
# POST /active_admin/comments(.:format) active_admin/comments#create
|
208
|
+
# active_admin_comment GET /active_admin/comments/:id(.:format) active_admin/comments#show
|
209
|
+
# DELETE /active_admin/comments/:id(.:format) active_admin/comments#destroy
|
210
|
+
# rails_postmark_inbound_emails POST /rails/action_mailbox/postmark/inbound_emails(.:format) action_mailbox/ingresses/postmark/inbound_emails#create
|
211
|
+
# rails_relay_inbound_emails POST /rails/action_mailbox/relay/inbound_emails(.:format) action_mailbox/ingresses/relay/inbound_emails#create
|
212
|
+
# rails_sendgrid_inbound_emails POST /rails/action_mailbox/sendgrid/inbound_emails(.:format) action_mailbox/ingresses/sendgrid/inbound_emails#create
|
213
|
+
# rails_mandrill_inbound_health_check GET /rails/action_mailbox/mandrill/inbound_emails(.:format) action_mailbox/ingresses/mandrill/inbound_emails#health_check
|
214
|
+
# rails_mandrill_inbound_emails POST /rails/action_mailbox/mandrill/inbound_emails(.:format) action_mailbox/ingresses/mandrill/inbound_emails#create
|
215
|
+
# rails_mailgun_inbound_emails POST /rails/action_mailbox/mailgun/inbound_emails/mime(.:format) action_mailbox/ingresses/mailgun/inbound_emails#create
|
216
|
+
# rails_conductor_inbound_emails GET /rails/conductor/action_mailbox/inbound_emails(.:format) rails/conductor/action_mailbox/inbound_emails#index
|
217
|
+
# POST /rails/conductor/action_mailbox/inbound_emails(.:format) rails/conductor/action_mailbox/inbound_emails#create
|
218
|
+
# new_rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/new(.:format) rails/conductor/action_mailbox/inbound_emails#new
|
219
|
+
# rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#show
|
220
|
+
# new_rails_conductor_inbound_email_source GET /rails/conductor/action_mailbox/inbound_emails/sources/new(.:format) rails/conductor/action_mailbox/inbound_emails/sources#new
|
221
|
+
# rails_conductor_inbound_email_sources POST /rails/conductor/action_mailbox/inbound_emails/sources(.:format) rails/conductor/action_mailbox/inbound_emails/sources#create
|
222
|
+
# rails_conductor_inbound_email_reroute POST /rails/conductor/action_mailbox/:inbound_email_id/reroute(.:format) rails/conductor/action_mailbox/reroutes#create
|
223
|
+
# rails_conductor_inbound_email_incinerate POST /rails/conductor/action_mailbox/:inbound_email_id/incinerate(.:format) rails/conductor/action_mailbox/incinerates#create
|
224
|
+
# rails_service_blob GET /rails/active_storage/blobs/redirect/:signed_id/*filename(.:format) active_storage/blobs/redirect#show
|
225
|
+
# rails_service_blob_proxy GET /rails/active_storage/blobs/proxy/:signed_id/*filename(.:format) active_storage/blobs/proxy#show
|
226
|
+
# GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs/redirect#show
|
227
|
+
# rails_blob_representation GET /rails/active_storage/representations/redirect/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/redirect#show
|
228
|
+
# rails_blob_representation_proxy GET /rails/active_storage/representations/proxy/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/proxy#show
|
229
|
+
# GET /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations/redirect#show
|
230
|
+
# rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
|
231
|
+
# update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update
|
232
|
+
# rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# generado con pg_rails
|
2
|
+
|
3
|
+
class CreateEmails < ActiveRecord::Migration[7.1]
|
4
|
+
def change
|
5
|
+
create_table :emails do |t|
|
6
|
+
t.datetime :accepted_at
|
7
|
+
t.datetime :delivered_at
|
8
|
+
t.datetime :opened_at
|
9
|
+
t.string :from_address, null: false
|
10
|
+
t.string :from_name
|
11
|
+
t.string :reply_to
|
12
|
+
t.string :to, null: false
|
13
|
+
t.string :subject
|
14
|
+
t.string :body_input
|
15
|
+
t.string :tags, array: true
|
16
|
+
t.references :associated, polymorphic: true, index: true
|
17
|
+
t.string :content_eml
|
18
|
+
t.string :message_id
|
19
|
+
t.string :mailer
|
20
|
+
t.string :status_detail
|
21
|
+
t.integer :status, null: false, default: 0
|
22
|
+
|
23
|
+
|
24
|
+
t.references :creado_por, index: true
|
25
|
+
t.references :actualizado_por, index: true
|
26
|
+
|
27
|
+
|
28
|
+
t.timestamps
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
add_foreign_key :emails, :users, column: 'creado_por_id'
|
33
|
+
add_foreign_key :emails, :users, column: 'actualizado_por_id'
|
34
|
+
end
|
35
|
+
end
|