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