2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2011-11-24 21:46:19 +00:00
|
|
|
module Modules
|
|
|
|
module Models
|
|
|
|
module Owner
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
2012-04-26 02:38:33 +01:00
|
|
|
after_create lambda { relations.create :actor_id => owner.id, :actor_type => owner.class.to_s, :role => 'admin' }
|
2011-11-24 21:46:19 +00:00
|
|
|
end
|
|
|
|
|
2012-07-17 09:02:56 +01:00
|
|
|
def name_with_owner
|
|
|
|
"#{owner.respond_to?(:uname) ? owner.uname : owner.name}/#{self.name}"
|
2012-07-04 19:52:09 +01:00
|
|
|
end
|
2011-11-24 21:46:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|