diff --git a/HowtoRedmine.md b/HowtoRedmine.md index 9cf86491..43f1c399 100644 --- a/HowtoRedmine.md +++ b/HowtoRedmine.md @@ -283,6 +283,7 @@ bundle exec rails console ~~~ #### Creer un compte admin / mot de passe admin + ~~~ user = User.new(:firstname => "Admin", :lastname => "Admin", :mail => "admin@example.com", :mail_notification => "none", :status => 1) user.login = 'admin' @@ -291,3 +292,16 @@ user.salt = "270d36d363b07abc40245d02348a53a8" user.admin = true user.save ~~~ + +#### Compter les issues d'un projet / les supprimer + +Ceci est notamment utile à faire avant de supprimer un projet, ce qui est peut-être impossible via l'interfaces web si il y atrop d'issues : + +~~~ +> p = Project.find(42) +> p.issues.count + (0.1ms) SELECT COUNT(*) FROM "issues" WHERE "issues"."project_id" = 42 + => 1337 +> p.issues.each(&:destroy) +... +~~~