Permalink
Browse files

Fixed issue where Sham::Methods were not being included after the cha…

…nge to simplify _sham.rb files.
  • Loading branch information...
1 parent e1ae91d commit 224a2d842a217349abfc4e95cb2ec049b0b19587 @panthomakos committed Dec 5, 2010
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/sham.rb
View
@@ -14,11 +14,9 @@ def sham!
class Config
def self.activate!
- Dir["#{RAILS_ROOT}/sham/*_sham.rb"].each{ |f| require f }
-
- Sham.constants.each do |klass|
- matcher = klass.match(/(.*)Sham/)
- matcher[1].constantize.send(:include, Sham::Methods) unless matcher.blank?
+ Dir["#{RAILS_ROOT}/sham/*_sham.rb"].each do |f|
+ require f
+ (File.basename(f).match(/(.*)_sham.rb/)[1]).classify.constantize.send :include, Sham::Methods
end
end
end

0 comments on commit 224a2d8

Please sign in to comment.