Skip to content

Commit

Permalink
Need to handle the nil klass
Browse files Browse the repository at this point in the history
  • Loading branch information
edavis10 committed Sep 11, 2009
1 parent 8a33c2d commit c42ba55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasks/indexer.rake
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ namespace :db do
class_name = model_name.sub(/\.rb$/,'').camelize
begin
klass = class_name.split('::').inject(Object){ |klass,part| klass.const_get(part) }
if klass < ActiveRecord::Base && !klass.abstract_class?
model_classes << klass
end
rescue
klass = nil
end
if klass < ActiveRecord::Base && !klass.abstract_class?
model_classes << klass
# No-op
end
end
puts "Found #{model_classes.size} Models"
Expand Down

0 comments on commit c42ba55

Please sign in to comment.