mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
fix failing tests
Includes a monkey patch for Arel that may need to be removed when 4.0.0 final ships
This commit is contained in:
parent
80974fb0d5
commit
08498fee4f
10 changed files with 50 additions and 43 deletions
|
|
@ -18,9 +18,9 @@ class DataController < ApplicationController
|
|||
def yaml_export
|
||||
all_tables = {}
|
||||
|
||||
all_tables['todos'] = current_user.todos.includes(:tags)
|
||||
all_tables['contexts'] = current_user.contexts
|
||||
all_tables['projects'] = current_user.projects
|
||||
all_tables['todos'] = current_user.todos.includes(:tags).load
|
||||
all_tables['contexts'] = current_user.contexts.load
|
||||
all_tables['projects'] = current_user.projects.load
|
||||
|
||||
todo_tag_ids = Tag.find_by_sql([
|
||||
"SELECT DISTINCT tags.id "+
|
||||
|
|
@ -37,10 +37,10 @@ class DataController < ApplicationController
|
|||
tags = Tag.where("id IN (?) OR id IN (?)", todo_tag_ids, rec_todo_tag_ids)
|
||||
taggings = Tagging.where("tag_id IN (?) OR tag_id IN(?)", todo_tag_ids, rec_todo_tag_ids)
|
||||
|
||||
all_tables['tags'] = tags
|
||||
all_tables['taggings'] = taggings
|
||||
all_tables['notes'] = current_user.notes
|
||||
all_tables['recurring_todos'] = current_user.recurring_todos
|
||||
all_tables['tags'] = tags.load
|
||||
all_tables['taggings'] = taggings.load
|
||||
all_tables['notes'] = current_user.notes.load
|
||||
all_tables['recurring_todos'] = current_user.recurring_todos.load
|
||||
|
||||
result = all_tables.to_yaml
|
||||
result.gsub!(/\n/, "\r\n") # TODO: general functionality for line endings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue