suggested changes
This commit is contained in:
parent
6cf9ddbdea
commit
cc5d47e6de
1 changed files with 1 additions and 6 deletions
|
|
@ -72,16 +72,11 @@ module Admin
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@conference = Conference.new
|
@conference = Conference.new
|
||||||
@organizations = {}
|
|
||||||
Organization.all.each do |organization|
|
|
||||||
@organizations.store(organization.name, organization.id) if can? :create, Conference.new(organization: organization)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
org = Organization.find_or_create_by(name: 'organization')
|
|
||||||
@conference = Conference.new(conference_params)
|
@conference = Conference.new(conference_params)
|
||||||
@conference.organization = org
|
@conference.organization = Organization.find_or_create_by(name: 'organization')
|
||||||
if @conference.save
|
if @conference.save
|
||||||
# user that creates the conference becomes organizer of that conference
|
# user that creates the conference becomes organizer of that conference
|
||||||
current_user.add_role :organizer, @conference
|
current_user.add_role :organizer, @conference
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue