lib/padrino-gen/generators/components/orms/mongoid.rb in padrino-gen-0.9.27 vs lib/padrino-gen/generators/components/orms/mongoid.rb in padrino-gen-0.9.28
- old
+ new
@@ -26,12 +26,12 @@
# More installation and setup notes are on http://mongoid.org/docs/
MONGO
def setup_orm
require_dependencies 'bson_ext', :require => 'mongo'
- require_dependencies 'mongoid', :version => '2.0.0'
- require_dependencies 'SystemTimer', :require => 'system_timer'
+ require_dependencies 'mongoid'
+ require_dependencies('SystemTimer', :require => 'system_timer') if RUBY_VERSION =~ /1\.8/
create_file("config/database.rb", MONGOID.gsub(/!NAME!/, @app_name.underscore))
empty_directory('app/models')
end
MONGOID_MODEL = (<<-MODEL) unless defined?(MONGOID_MODEL)
@@ -64,6 +64,6 @@
# NO MIGRATION NEEDED
end
def create_migration_file(migration_name, name, columns)
# NO MIGRATION NEEDED
-end
\ No newline at end of file
+end