Replaces find(:first) calls in migrations.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10929 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
31c33f462d
commit
738cf2e187
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue