public
Description: Gitorious aims to provide a great way of doing distributed opensource code collaboration.
Homepage: http://gitorious.org/projects/gitorious
Clone URL: git://github.com/dysinger/gitorious.git
Search Repo:
Prefer String#constantize over eval
Johan Sørensen (author)
Sun May 04 08:04:51 -0700 2008
commit  5e61707eeed61828047c8ba882e04fa694ede4f4
tree    d7551c47fa27ad3e14c32ddfb7126e93ae7475a2
parent  2f0fb95e5e4605b7be2fdba1e6112090c1b18761
...
5
6
7
8
 
9
10
11
...
5
6
7
 
8
9
10
11
0
@@ -5,7 +5,7 @@ require File.dirname(__FILE__)+'/../config/environment'
0
 
0
 Event.find(:all).each do |event|
0
   begin
0
- eval("#{event.target_type}").find(event.target_id)
0
+ event.target_type.constantize.find(event.target_id)
0
     Project.find(event.project_id)
0
   rescue ActiveRecord::RecordNotFound
0
     puts "Destroying invalid event '#{event.id}:#{Action.name(event.action)}'"

Comments

    No one has commented yet.