##// END OF EJS Templates
Replaces find(:first) calls in migrations....
Jean-Philippe Lang -
r10702:738cf2e187f9
parent child
Show More
@@ -7,6 +7,6 class IssueMove < ActiveRecord::Migration
7 end
7 end
8
8
9 def self.down
9 def self.down
10 Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'move_issues']).destroy
10 Permission.where("controller=? and action=?", 'projects', 'move_issues').first.destroy
11 end
11 end
12 end
12 end
@@ -7,6 +7,6 class IssueAddNote < ActiveRecord::Migration
7 end
7 end
8
8
9 def self.down
9 def self.down
10 Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'add_note']).destroy
10 Permission.where("controller=? and action=?", 'issues', 'add_note').first.destroy
11 end
11 end
12 end
12 end
@@ -8,7 +8,7 class ExportPdf < ActiveRecord::Migration
8 end
8 end
9
9
10 def self.down
10 def self.down
11 Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'export_issues_pdf']).destroy
11 Permission.where("controller=? and action=?", 'projects', 'export_issues_pdf').first.destroy
12 Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'export_pdf']).destroy
12 Permission.where("controller=? and action=?", 'issues', 'export_pdf').first.destroy
13 end
13 end
14 end
14 end
@@ -9,8 +9,8 class CalendarAndActivity < ActiveRecord::Migration
9 end
9 end
10
10
11 def self.down
11 def self.down
12 Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'activity']).destroy
12 Permission.where("controller=? and action=?", 'projects', 'activity').first.destroy
13 Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'calendar']).destroy
13 Permission.where("controller=? and action=?", 'projects', 'calendar').first.destroy
14 Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'gantt']).destroy
14 Permission.where("controller=? and action=?", 'projects', 'gantt').first.destroy
15 end
15 end
16 end
16 end
@@ -51,6 +51,6 class CreateJournals < ActiveRecord::Migration
51
51
52 add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
52 add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
53
53
54 Permission.find(:first, :conditions => ["controller=? and action=?", 'issues', 'history']).destroy
54 Permission.where("controller=? and action=?", 'issues', 'history').first.destroy
55 end
55 end
56 end
56 end
@@ -8,7 +8,7 class AddCommentsPermissions < ActiveRecord::Migration
8 end
8 end
9
9
10 def self.down
10 def self.down
11 Permission.find(:first, :conditions => ["controller=? and action=?", 'news', 'add_comment']).destroy
11 Permission.where("controller=? and action=?", 'news', 'add_comment').first.destroy
12 Permission.find(:first, :conditions => ["controller=? and action=?", 'news', 'destroy_comment']).destroy
12 Permission.where("controller=? and action=?", 'news', 'destroy_comment').first.destroy
13 end
13 end
14 end
14 end
@@ -7,6 +7,6 class AddQueriesPermissions < ActiveRecord::Migration
7 end
7 end
8
8
9 def self.down
9 def self.down
10 Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'add_query']).destroy
10 Permission.where("controller=? and action=?", 'projects', 'add_query').first.destroy
11 end
11 end
12 end
12 end
@@ -12,11 +12,11 class AddRepositoriesPermissions < ActiveRecord::Migration
12 end
12 end
13
13
14 def self.down
14 def self.down
15 Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'show']).destroy
15 Permission.where("controller=? and action=?", 'repositories', 'show').first.destroy
16 Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'browse']).destroy
16 Permission.where("controller=? and action=?", 'repositories', 'browse').first.destroy
17 Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'entry']).destroy
17 Permission.where("controller=? and action=?", 'repositories', 'entry').first.destroy
18 Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'revisions']).destroy
18 Permission.where("controller=? and action=?", 'repositories', 'revisions').first.destroy
19 Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'revision']).destroy
19 Permission.where("controller=? and action=?", 'repositories', 'revision').first.destroy
20 Permission.find(:first, :conditions => ["controller=? and action=?", 'repositories', 'diff']).destroy
20 Permission.where("controller=? and action=?", 'repositories', 'diff').first.destroy
21 end
21 end
22 end
22 end
@@ -7,6 +7,6 class AddRoadmapPermission < ActiveRecord::Migration
7 end
7 end
8
8
9 def self.down
9 def self.down
10 Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'roadmap']).destroy
10 Permission.where("controller=? and action=?", 'projects', 'roadmap').first.destroy
11 end
11 end
12 end
12 end
General Comments 0
You need to be logged in to leave comments. Login now