start fixing deprecation warnings

This commit is contained in:
Reinier Balt 2013-05-11 23:13:32 +02:00
parent 0bc9b0397a
commit ebff4cfc0c
9 changed files with 74 additions and 79 deletions

View file

@ -18,9 +18,9 @@ class DataController < ApplicationController
def yaml_export
all_tables = {}
all_tables['todos'] = current_user.todos.includes(:tags).all
all_tables['contexts'] = current_user.contexts.all
all_tables['projects'] = current_user.projects.all
all_tables['todos'] = current_user.todos.includes(:tags)
all_tables['contexts'] = current_user.contexts
all_tables['projects'] = current_user.projects
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
all_tables['taggings'] = taggings.all
all_tables['notes'] = current_user.notes.all
all_tables['recurring_todos'] = current_user.recurring_todos.all
all_tables['tags'] = tags
all_tables['taggings'] = taggings
all_tables['notes'] = current_user.notes
all_tables['recurring_todos'] = current_user.recurring_todos
result = all_tables.to_yaml
result.gsub!(/\n/, "\r\n") # TODO: general functionality for line endings

View file

@ -3,7 +3,7 @@ class NotesController < ApplicationController
before_filter :set_source_view
def index
@all_notes = current_user.notes.all
@all_notes = current_user.notes
@count = @all_notes.size
@page_title = "TRACKS::All notes"
@source_view = 'note_list'

View file

@ -18,7 +18,7 @@ class ProjectsController < ApplicationController
if params[:only_active_with_no_next_actions]
@projects = current_user.projects.active.select { |p| count_undone_todos(p) == 0 }
else
@projects = current_user.projects.all
@projects = current_user.projects
end
@new_project = current_user.projects.build
@active_projects = current_user.projects.active

View file

@ -11,14 +11,14 @@ class UsersController < ApplicationController
respond_to do |format|
format.html do
@page_title = "TRACKS::Manage Users"
@users = User.paginate :page => params[:page], :order => 'login ASC'
@users = User.order('login ASC').paginate :page => params[:page]
@total_users = User.count
# When we call users/signup from the admin page we store the URL so that
# we get returned here when signup is successful
store_location
end
format.xml do
@users = User.order('login').all
@users = User.order('login')
render :xml => @users.to_xml(:except => [ :password ])
end
end
@ -138,7 +138,7 @@ class UsersController < ApplicationController
def destroy
@deleted_user = User.find(params[:id])
@saved = @deleted_user.destroy
@total_users = User.all.size
@total_users = User.size
respond_to do |format|
format.html do