Introduce organization admins
This commit is contained in:
parent
f37d3095e1
commit
b72e64b238
6 changed files with 96 additions and 41 deletions
|
|
@ -1,7 +1,17 @@
|
|||
class Organization < ActiveRecord::Base
|
||||
resourcify :roles, dependent: :delete_all
|
||||
|
||||
has_many :conferences, dependent: :destroy
|
||||
|
||||
after_create :create_roles
|
||||
|
||||
validates :name, presence: true
|
||||
|
||||
mount_uploader :picture, PictureUploader, mount_on: :picture
|
||||
|
||||
private
|
||||
|
||||
def create_roles
|
||||
Role.where(name: 'organization_admin', resource: self).first_or_create(description: "For the administrators of an organization (who shall have full access to the organization and it's conferences)")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue