From bc2e8007b17427138812cf655d0d411169670d4d Mon Sep 17 00:00:00 2001 From: lrbalt Date: Tue, 16 Oct 2007 07:16:22 +0000 Subject: [PATCH] Fixes #586 by changing ID into id. Thanks for reporting this. Also fixes a small todo fixture error where the creation date was newer than the completed date git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@621 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/controllers/data_controller.rb | 4 ++-- tracks/test/fixtures/todos.yml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tracks/app/controllers/data_controller.rb b/tracks/app/controllers/data_controller.rb index 53ef8d80..b89857db 100644 --- a/tracks/app/controllers/data_controller.rb +++ b/tracks/app/controllers/data_controller.rb @@ -30,7 +30,7 @@ class DataController < ApplicationController def csv_actions content_type = 'text/csv' CSV::Writer.generate(result = "") do |csv| - csv << ["ID", "Context", "Project", "Description", "Notes", + csv << ["id", "Context", "Project", "Description", "Notes", "Created at", "Due", "Completed at", "User ID", "Show from", "state"] current_user.todos.find(:all, :include => [:context, :project]).each do |todo| @@ -53,7 +53,7 @@ class DataController < ApplicationController def csv_notes content_type = 'text/csv' CSV::Writer.generate(result = "") do |csv| - csv << ["ID", "User ID", "Project", "Note", + csv << ["id", "User ID", "Project", "Note", "Created at", "Updated at"] # had to remove project include because it's association order is leaking through # and causing an ambiguous column ref even with_exclusive_scope didn't seem to help -JamesKebinger diff --git a/tracks/test/fixtures/todos.yml b/tracks/test/fixtures/todos.yml index 3bcf2f5d..cbc6f545 100644 --- a/tracks/test/fixtures/todos.yml +++ b/tracks/test/fixtures/todos.yml @@ -13,6 +13,10 @@ def last_week 1.week.ago.utc.beginning_of_day.to_s(:db) end +def two_weeks_ago + 2.weeks.ago.utc.beginning_of_day.to_s(:db) +end + def two_weeks_hence 2.weeks.from_now.utc.beginning_of_day.to_s(:db) end @@ -134,7 +138,7 @@ end description: foo notes: ~ state: completed - created_at: <%= today %> + created_at: <%= two_weeks_ago %> due: <%= two_weeks_hence %> completed_at: <%= last_week %> user_id: 1