Specify correct default values for events

This commit is contained in:
Petko Bordjukov 2015-08-20 00:33:13 +03:00
parent cd44861988
commit 167030f90d
2 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,10 @@ class Event < ActiveRecord::Base
proposer.personal_profile(conference)
end
def length
read_attribute(:length) || event_type.try(:minimum_length)
end
private
def track_belongs_to_the_selected_conference

View File

@ -0,0 +1,5 @@
class DropDefaultValueForLengthInEvents < ActiveRecord::Migration
def change
change_column_default(:events, :length, nil)
end
end