Closed mattherick closed 12 years ago
It should be:
validates :end_at, :date => { :after => :start_at, :before => Proc.new { |record| record.start_at + 9.days } }
Because when given a proc, it yields the record, so you can call methods on it (or provide a block with no arguments as well).
is it possible to do something like that: validates :end_at, :date => { :after => :start_at, :before => Proc.new { :start_at + 9.days } }
Thanks in advance for a short answer.