lib/sportdb/loader.rb in sportdb-0.3.0 vs lib/sportdb/loader.rb in sportdb-0.3.1
- old
+ new
@@ -1,10 +1,15 @@
module SportDB
class Loader
+## make models available in sportdb module by default with namespace
+# e.g. lets you use Team instead of Models::Team
+ include SportDB::Models
+
+
def initialize
@logger = Logger.new(STDOUT)
@logger.level = Logger::INFO
end
@@ -41,10 +46,10 @@
puts "*** loading data '#{name}' (#{path})..."
text = File.read( path )
- SportDB.module_eval( text )
+ self.class_eval( text )
# NB: same as
#
# module SportDB
# <code here>
\ No newline at end of file