Commit 9d70e731 authored by jplang's avatar jplang

Replaces find(:first) calls in migrations.

git-svn-id: https://svn.redmine.org/redmine/trunk@10929 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c0fd6ad1
......@@ -7,6 +7,6 @@ class IssueMove < ActiveRecord::Migration
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'move_issues']).destroy
Permission.where("controller=? and action=?", 'projects', 'move_issues').first.destroy
end
end
......@@ -7,6 +7,6 @@ class IssueAddNote < ActiveRecord::Migration
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'add_note']).destroy
Permission.where("controller=? and action=?", 'issues', 'add_note').first.destroy
end
end
......@@ -8,7 +8,7 @@ class ExportPdf < ActiveRecord::Migration
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'export_issues_pdf']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'export_pdf']).destroy
Permission.where("controller=? and action=?", 'projects', 'export_issues_pdf').first.destroy
Permission.where("controller=? and action=?", 'issues', 'export_pdf').first.destroy
end
end
......@@ -9,8 +9,8 @@ class CalendarAndActivity < ActiveRecord::Migration
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'activity']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'calendar']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'gantt']).destroy
Permission.where("controller=? and action=?", 'projects', 'activity').first.destroy
Permission.where("controller=? and action=?", 'projects', 'calendar').first.destroy
Permission.where("controller=? and action=?", 'projects', 'gantt').first.destroy
end
end
......@@ -51,6 +51,6 @@ class CreateJournals < ActiveRecord::Migration
add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'history']).destroy
Permission.where("controller=? and action=?", 'issues', 'history').first.destroy
end
end
......@@ -8,7 +8,7 @@ class AddCommentsPermissions < ActiveRecord::Migration
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'news', 'add_comment']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'news', 'destroy_comment']).destroy
Permission.where("controller=? and action=?", 'news', 'add_comment').first.destroy
Permission.where("controller=? and action=?", 'news', 'destroy_comment').first.destroy
end
end
......@@ -7,6 +7,6 @@ class AddQueriesPermissions < ActiveRecord::Migration
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'add_query']).destroy
Permission.where("controller=? and action=?", 'projects', 'add_query').first.destroy
end
end
......@@ -12,11 +12,11 @@ class AddRepositoriesPermissions < ActiveRecord::Migration
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'show']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'browse']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'entry']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'revisions']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'revision']).destroy
Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'diff']).destroy
Permission.where("controller=? and action=?", 'repositories', 'show').first.destroy
Permission.where("controller=? and action=?", 'repositories', 'browse').first.destroy
Permission.where("controller=? and action=?", 'repositories', 'entry').first.destroy
Permission.where("controller=? and action=?", 'repositories', 'revisions').first.destroy
Permission.where("controller=? and action=?", 'repositories', 'revision').first.destroy
Permission.where("controller=? and action=?", 'repositories', 'diff').first.destroy
end
end
......@@ -7,6 +7,6 @@ class AddRoadmapPermission < ActiveRecord::Migration
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'roadmap']).destroy
Permission.where("controller=? and action=?", 'projects', 'roadmap').first.destroy
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment