Hi,
I'm building my first Rails project - its a ToDo app, which are supposed to send out warnings when a Task are X minutes from its deadline.
Im trying to create a variabel with the tasks that are X minutes from its deadline. The X minutes are diffrent for every Task - which means that its stored in the database. So I got two columns in the database.
1: Task.close_time => A Time column with the actual deadline of the Task.
2: Task.close_time_warning => A integer column with how many minutes the warning should be sent out before the deadlone.
I then have the following code, but I get errors trying to load the rss feed whit the warnings.
def warnings
@warnings = Task.find(:all, :conditions => ["completed_at = ? and state_active = ? and close_time < ?", nil, true, Date.new(2000, 1, 1).to_datetime + Time.now.seconds_since_midnight.seconds + task.close_time_warning.minutes])
respond_to do |format|
format.rss
end
end
Help is wanted :)
Kenneth