suggested changes

This commit is contained in:
shlok007 2017-06-10 19:36:50 +05:30
parent 6cf9ddbdea
commit cc5d47e6de

View file

@ -72,16 +72,11 @@ module Admin
def 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
def create
org = Organization.find_or_create_by(name: 'organization')
@conference = Conference.new(conference_params)
@conference.organization = org
@conference.organization = Organization.find_or_create_by(name: 'organization')
if @conference.save
# user that creates the conference becomes organizer of that conference
current_user.add_role :organizer, @conference