Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Update cleanup_models method to handle blank model names
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Jun 6, 2010
1 parent 1f85c85 commit 4b41dca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/dm-core/spec/lib/spec_helper.rb
Expand Up @@ -17,8 +17,9 @@ def self.cleanup_models
while model = descendants.shift
descendants.concat(model.descendants.to_a - [ model ])

unless model.name.to_s[0] == ?#
parts = model.name.split('::')
model_name = model.name.to_s.strip
unless model_name.empty?
parts = model_name.split('::')
constant_name = parts.pop.to_sym
base = parts.empty? ? Object : Object.full_const_get(parts.join('::'))

Expand Down

0 comments on commit 4b41dca

Please sign in to comment.