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:
parent
7fd738bc7d
commit
c3eb178546
8 changed files with 120 additions and 5 deletions
15
db/migrate/20170530072155_add_type_to_cfps.rb
Normal file
15
db/migrate/20170530072155_add_type_to_cfps.rb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class AddTypeToCfps < ActiveRecord::Migration
|
||||
class TmpCfp < ActiveRecord::Base
|
||||
self.table_name = 'cfps'
|
||||
end
|
||||
|
||||
def change
|
||||
add_column :cfps, :cfp_type, :string
|
||||
|
||||
TmpCfp.reset_column_information
|
||||
TmpCfp.find_each do |cfp|
|
||||
cfp.cfp_type = 'events'
|
||||
cfp.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue