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
This commit is contained in:
lrbalt 2007-10-16 07:16:22 +00:00
parent ccccb53663
commit bc2e8007b1
2 changed files with 7 additions and 3 deletions

View file

@ -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

View file

@ -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