updated code to be rails 3/redmine 2 compatible