Rename notifications.body to text

This commit is contained in:
Artur Beljajev 2018-08-23 21:26:33 +03:00
parent 8765baf319
commit dfff6f6d12
16 changed files with 30 additions and 22 deletions

View file

@ -6,7 +6,7 @@ module Admin
domain.transaction do
domain.schedule_force_delete
domain.registrar.notifications.create!(body: t('force_delete_set_on_domain',
domain.registrar.notifications.create!(text: t('force_delete_set_on_domain',
domain_name: domain.name))
if notify_by_email?

View file

@ -9,7 +9,7 @@ class DomainDeleteJob < Que::Job
domain.destroy
bye_bye = domain.versions.last
domain.registrar.notifications.create!(
body: "#{I18n.t(:domain_deleted)}: #{domain.name}",
text: "#{I18n.t(:domain_deleted)}: #{domain.name}",
attached_obj_id: bye_bye.id,
attached_obj_type: bye_bye.class.to_s
)

View file

@ -272,7 +272,7 @@ class Domain < ActiveRecord::Base
def notify_registrar(message_key)
registrar.notifications.create!(
body: "#{I18n.t(message_key)}: #{name}",
text: "#{I18n.t(message_key)}: #{name}",
attached_obj_id: id,
attached_obj_type: self.class.to_s
)

View file

@ -74,7 +74,7 @@ class DomainTransfer < ActiveRecord::Base
old_registrant_code = domain.registrant.code
old_registrar.notifications.create!(
body: I18n.t('notifications.texts.domain_transfer',
text: I18n.t('notifications.texts.domain_transfer',
domain_name: domain.name,
old_contacts_codes: old_contacts_codes,
old_registrant_code: old_registrant_code),

View file

@ -626,7 +626,7 @@ class Epp::Domain < Domain
if dt.pending?
registrar.notifications.create!(
body: I18n.t('transfer_requested'),
text: I18n.t('transfer_requested'),
attached_obj_id: dt.id,
attached_obj_type: dt.class.to_s
)
@ -728,7 +728,7 @@ class Epp::Domain < Domain
return false unless valid?
registrar.notifications.create!(
body: 'Key Relay action completed successfully.',
text: 'Key Relay action completed successfully.',
attached_obj_type: kr.class.to_s,
attached_obj_id: kr.id
)

View file

@ -6,7 +6,7 @@ class Notification < ActiveRecord::Base
scope :queued, -> { where(queued: true) }
validates :body, presence: true
validates :text, presence: true
def dequeue
self.queued = false

View file

@ -12,7 +12,7 @@ xml.epp(
xml.tag!('msgQ', 'count' => current_user.queued_notifications.count, 'id' => @notification.id) do
xml.qDate @notification.created_at.try(:iso8601)
xml.msg @notification.body
xml.msg @notification.text
end
xml.resData do

View file

@ -6,7 +6,7 @@ xml.epp_head do
xml.tag!('msgQ', 'count' => current_user.queued_notifications.count, 'id' => @notification.id) do
xml.qDate @notification.created_at.try(:iso8601)
xml.msg @notification.body
xml.msg @notification.text
end
if @notification.attached_obj_type == 'DomainTransfer'