lib/kitsune.rb in kitsune-0.0.19 vs lib/kitsune.rb in kitsune-0.1.0

- old
+ new

@@ -6,11 +6,11 @@ autoload :FauxColumn, 'kitsune/faux_column' autoload :Inspector, 'kitsune/inspector' autoload :Page, 'kitsune/page' class << self def version - '0.0.19' + '0.1.0' end def model_paths # abstract this to something else @models_paths ||= ["#{RAILS_ROOT}/app/models"] end @@ -27,10 +27,14 @@ models = [] model_paths.each do |path| Dir.glob(path+'/*').each do |file| begin klass = File.basename(file).gsub(/^(.+).rb/, '\1').classify.constantize - models << klass if klass.ancestors.include?(::ActiveRecord::Base) + if defined? ::ActiveRecord + models << klass if klass.ancestors.include?(::ActiveRecord::Base) + else defined? ::MongoMapper + models << klass if klass.ancestors.include?(::MongoMapper::Document) + end rescue Exception => e # not valid end end end