rosa-build/lib/modules/models/owner.rb

17 lines
396 B
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
module Modules
module Models
module Owner
extend ActiveSupport::Concern
included do
after_create lambda { relations.create :actor_id => owner.id, :actor_type => owner.class.to_s, :role => 'admin' }
end
def name_with_owner
"#{owner.respond_to?(:uname) ? owner.uname : owner.name}/#{self.name}"
end
end
end
end