Skip to content

Commit

Permalink
Add migration for is open published #178
Browse files Browse the repository at this point in the history
  • Loading branch information
palcu committed Aug 6, 2015
1 parent 2b69aa5 commit 51a40a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/contestant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Contestant < ActiveRecord::Base
validates :mentoring_teacher_last_name, presence: true

# TODO @palcu: add validation for is_in_open
validates :is_in_open, presence: true

before_destroy :delete_orphan_projects, prepend: true

Expand Down
1 change: 1 addition & 0 deletions app/models/edition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Edition < ActiveRecord::Base
validates :travel_data_deadline, date: { allow_blank: true }
validates :projects_forum_category, presence: true
validates :talks_forum_category, presence: true
validates :is_open_published, presence: true

validates :published, presence: true, if: Proc.new { |edition|
self.current == true
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20150806073814_add_is_open_published_to_edition.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddIsOpenPublishedToEdition < ActiveRecord::Migration
def change
add_column :editions, :is_open_published, :boolean, :default => false
end
end

0 comments on commit 51a40a4

Please sign in to comment.