[#345] temporaly fix error with mass-assign protected attributes

This commit is contained in:
Alexander Machehin 2014-03-13 16:43:04 +06:00
parent bfc64162e1
commit 8ff7ae6870
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,8 @@ module Owner
included do included do
validates :owner, presence: true 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
end end