From 1183d06c09fa7ba5c349add336a7373e1e27235e Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 24 Aug 2018 14:18:40 +0300 Subject: [PATCH] Remove app-level association validation --- app/models/notification.rb | 2 +- test/models/notification_test.rb | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index b0b373978..1e9dfa3dd 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -1,6 +1,6 @@ class Notification < ActiveRecord::Base include Versions # version/notification_version.rb - belongs_to :registrar, required: true + belongs_to :registrar scope :unread, -> { where(read: false) } diff --git a/test/models/notification_test.rb b/test/models/notification_test.rb index e6783efcf..bfd577fb9 100644 --- a/test/models/notification_test.rb +++ b/test/models/notification_test.rb @@ -14,11 +14,6 @@ class NotificationTest < ActiveSupport::TestCase assert @notification.invalid? end - def test_invalid_without_registrar - @notification.registrar = nil - assert @notification.invalid? - end - def test_unread_by_default notification = Notification.new(registrar: registrars(:bestnames), text: 'test') assert notification.unread?