From 8ff7ae687002a418d80de9e6b98b53c993c7c663 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 13 Mar 2014 16:43:04 +0600 Subject: [PATCH] [#345] temporaly fix error with mass-assign protected attributes --- app/models/concerns/owner.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/owner.rb b/app/models/concerns/owner.rb index c7d2d489a..7de6f5be6 100644 --- a/app/models/concerns/owner.rb +++ b/app/models/concerns/owner.rb @@ -3,6 +3,8 @@ module Owner included do validates :owner, presence: true - after_create -> { relations.create actor_id: owner.id, actor_type: owner.class.to_s, role: 'admin' } + after_create do + relations.create({ actor_id: owner.id, actor_type: owner.class.to_s, role: 'admin' }, without_protection: true) + end end end