Displaying 1 result from an estimated 1 matches for "createvigil".
Did you mean:
createvigils
2007 Jul 08
2
datetime_select, is creating an instance of the Time class
...e
@vigil = Vigil.new(params[:vigil])
#
# @vigil.start_date.class returns Time
#
end
Model
class Vigil < ActiveRecord::Base
def validate
if start_date < created_at
errors.add(:start_date, "must be in the future")
end
end
end
Migration for vigil table:
class CreateVigils < ActiveRecord::Migration
def self.up
create_table :vigils do |t|
t.column :name, :string, :null => false
t.column :purpose, :string, :null => false
t.column :location, :string
t.column :start_date, :datetime, :null => false
t.colu...