mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-10 09:24:22 +01:00
Apply James Kebinger's patch to fix #492 (broken: csv export of notes). Thanks SK for
the bug report and James for the patch! git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@518 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
ba0b52ff1a
commit
179d194fb2
2 changed files with 9 additions and 3 deletions
|
|
@ -55,7 +55,9 @@ class DataController < ApplicationController
|
|||
CSV::Writer.generate(result = "") do |csv|
|
||||
csv << ["ID", "User ID", "Project", "Note",
|
||||
"Created at", "Updated at"]
|
||||
@user.notes.find(:all, :include => [:project]).each do |note|
|
||||
# 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
|
||||
@user.notes.find(:all,:order=>"notes.created_at").each do |note|
|
||||
# Format dates in ISO format for easy sorting in spreadsheet
|
||||
# Print context and project names for easy viewing
|
||||
csv << [note.id, note.user_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue