2014-03-11 08:58:36 +00:00
|
|
|
module Owner
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
validates :owner, presence: true
|
2014-03-13 10:43:04 +00:00
|
|
|
after_create do
|
|
|
|
relations.create({ actor_id: owner.id, actor_type: owner.class.to_s, role: 'admin' }, without_protection: true)
|
|
|
|
end
|
2014-03-11 08:58:36 +00:00
|
|
|
end
|
|
|
|
end
|