From ea296a109a8655ea48c02c1d0a9bb0d19002d236 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 3 Dec 2012 21:30:10 +0000 Subject: Replaces find(:first/:all) calls. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10931 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/tasks/migrate_from_mantis.rake | 4 ++-- lib/tasks/migrate_from_trac.rake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index 02ce9f472..8844da65d 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -30,7 +30,7 @@ task :migrate_from_mantis => :environment do assigned_status = IssueStatus.find_by_position(2) resolved_status = IssueStatus.find_by_position(3) feedback_status = IssueStatus.find_by_position(4) - closed_status = IssueStatus.find :first, :conditions => { :is_closed => true } + closed_status = IssueStatus.where(:is_closed => true).first STATUS_MAPPING = {10 => DEFAULT_STATUS, # new 20 => feedback_status, # feedback 30 => DEFAULT_STATUS, # acknowledged @@ -347,7 +347,7 @@ task :migrate_from_mantis => :environment do bug.bug_files.each do |file| a = Attachment.new :created_on => file.date_added a.file = file - a.author = User.find :first + a.author = User.first a.container = i a.save end diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index e419775d1..95c4b5560 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -30,7 +30,7 @@ namespace :redmine do assigned_status = IssueStatus.find_by_position(2) resolved_status = IssueStatus.find_by_position(3) feedback_status = IssueStatus.find_by_position(4) - closed_status = IssueStatus.find :first, :conditions => { :is_closed => true } + closed_status = IssueStatus.where(:is_closed => true).first STATUS_MAPPING = {'new' => DEFAULT_STATUS, 'reopened' => feedback_status, 'assigned' => assigned_status, -- cgit v1.2.3