Modify CFP to accept proposals for other things

Add field cfp_type and relevant validations
Add Program#cfp to preserve backwards compatibility
Add 'for_events' scope to the cfp, in order for it to be used like
program.cfps.events
Add useful methods
Add rspec test for the new code
The supported cfp types can be viewed via Cfp::TYPES
This commit is contained in:
AEtherC0r3 2017-05-30 20:54:48 +03:00 committed by Stella Rouzi
parent 7fd738bc7d
commit c3eb178546
8 changed files with 120 additions and 5 deletions

View file

@ -2,7 +2,7 @@ module Admin
class CfpsController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :program, through: :conference, singleton: true
load_and_authorize_resource through: :program, singleton: true
load_and_authorize_resource through: :program
def show; end
@ -27,7 +27,6 @@ module Admin
end
def update
@cfp = @program.cfp
@cfp.assign_attributes(cfp_params)
send_mail_on_cfp_dates_updates = @cfp.notify_on_cfp_date_update?