From 19ea77385e05c9fb483e4a5a75080bd6b305eafa Mon Sep 17 00:00:00 2001 From: shashank76 <36919726+shashank76@users.noreply.github.com> Date: Mon, 19 Nov 2018 23:48:49 +0530 Subject: [PATCH] Add optional true for blocker id field in frienship model for frindship create --- lib/amistad/active_record_friendship_model.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/amistad/active_record_friendship_model.rb b/lib/amistad/active_record_friendship_model.rb index 4046a02..37e17ec 100644 --- a/lib/amistad/active_record_friendship_model.rb +++ b/lib/amistad/active_record_friendship_model.rb @@ -13,7 +13,7 @@ module ActiveRecordFriendshipModel belongs_to :blocker, :class_name => Amistad.friend_model, - :foreign_key => "blocker_id" + :foreign_key => "blocker_id", optional: true validates_presence_of :friendable_id, :friend_id validates_uniqueness_of :friend_id, :scope => :friendable_id