Fixes #835 where the yml_export failed to find the tags of a user. Thanks Peter for this report

This commit is contained in:
Reinier Balt 2009-02-08 15:25:42 +01:00
parent 494cb11903
commit 949c746215
2 changed files with 21 additions and 2 deletions

View file

@ -21,8 +21,22 @@ class DataController < ApplicationController
all_tables['todos'] = current_user.todos.find(:all)
all_tables['contexts'] = current_user.contexts.find(:all)
all_tables['projects'] = current_user.projects.find(:all)
all_tables['tags'] = current_user.tags.find(:all)
all_tables['taggings'] = current_user.taggings.find(:all)
tags = Tag.find_by_sql([
"SELECT tags.* "+
"FROM tags, taggings, todos "+
"WHERE todos.user_id=? "+
"AND tags.id = taggings.tag_id " +
"AND taggings.taggable_id = todos.id ", current_user.id])
all_tables['tags'] = tags
taggings = Tagging.find_by_sql([
"SELECT taggings.* "+
"FROM taggings, todos "+
"WHERE todos.user_id=? "+
"AND taggings.taggable_id = todos.id ", current_user.id])
all_tables['taggings'] = taggings
all_tables['notes'] = current_user.notes.find(:all)
all_tables['recurring_todos'] = current_user.recurring_todos.find(:all)

View file

@ -18,4 +18,9 @@ class DataControllerTest < Test::Rails::TestCase
login_as :admin_user
get :csv_notes
end
def test_yml_export_comleted_without_error
login_as :admin_user
get :yaml_export
end
end