Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
don’t force loading of constants waiting for autoload
Browse files Browse the repository at this point in the history
  • Loading branch information
ronen committed Jan 18, 2015
1 parent 81d19b3 commit 139a8ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/schema_monkey/module_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_modules(parent, opts={})
return [] unless parent && parent.is_a?(Module)
modules = []
modules << parent if opts.and_self
modules += parent.constants.map{|c| parent.const_get(c)}.select(&it.is_a?(Module))
modules += parent.constants.reject{|c| parent.autoload? c}.map{|c| parent.const_get(c)}.select(&it.is_a?(Module))
modules.reject! &it.to_s =~ opts.reject if opts.reject
modules.select! &it.to_s =~ opts.match if opts.match
modules.select! &it.respond_to?(opts.respond_to) if opts.respond_to
Expand Down

0 comments on commit 139a8ff

Please sign in to comment.