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

@ -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