lib/ronin/auto_load.rb in ronin-1.3.0 vs lib/ronin/auto_load.rb in ronin-1.4.0.rc1
- old
+ new
@@ -16,10 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
#
require 'open_namespace'
+require 'dm-core'
module Ronin
#
# When included into other namespaces, it allows for auto-loading Classes
# or Modules via {ClassMethods#const_missing}.
@@ -53,14 +54,12 @@
# @api public
#
def const_missing(name)
const = super(name)
- if Object.const_defined?('DataMapper')
- # if the loaded Class is a DataMapper Resource, re-finalize
- if const < DataMapper::Resource
- DataMapper.finalize
- end
+ # if the loaded Class is a DataMapper Resource, re-finalize
+ if const < DataMapper::Resource
+ const.finalize
end
return const
end
end