lib/padrino-gen/generators/components/orms/mongoid.rb in padrino-gen-0.11.4 vs lib/padrino-gen/generators/components/orms/mongoid.rb in padrino-gen-0.12.0.rc1
- old
+ new
@@ -72,20 +72,11 @@
#
# More installation and setup notes are on http://mongoid.org/en/mongoid/docs/installation.html#configuration
MONGO
def setup_orm
- require_dependencies 'mongoid', :version => (RUBY_VERSION >= '1.9' ? '~>3.0.0' : '~>2.0')
-
- if RUBY_VERSION =~ /1\.8/ && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')
- require_dependencies('SystemTimer', :require => 'system_timer')
- end
-
- if RUBY_VERSION >= '1.9'
- create_file('config/database.rb', MONGOID3.gsub(/!NAME!/, @project_name.underscore))
- else
- create_file('config/database.rb', MONGOID.gsub(/!NAME!/, @project_name.underscore))
- end
+ require_dependencies 'mongoid', :version => '~>3.0.0'
+ create_file('config/database.rb', MONGOID3.gsub(/!NAME!/, @project_name.underscore))
end
MONGOID_MODEL = (<<-MODEL) unless defined?(MONGOID_MODEL)
class !NAME!
include Mongoid::Document