Skip to content
Browse files

use datamapper4rail to get things working

Signed-off-by: Jeremy McAnally <jeremymcanally@gmail.com>
  • Loading branch information...
1 parent 4dad584 commit 939a0f5bc1d05694df2b98c488603263043fbdb5 @mkristian mkristian committed with
Showing with 17 additions and 13 deletions.
  1. +17 −13 datamapper.rb
View
30 datamapper.rb
@@ -1,28 +1,32 @@
# inspired by http://www.rowtheboat.com/archives/32
-# have specs
-plugin 'rspec',
- :git => 'git://github.com/dchelimsky/rspec.git'
-plugin 'rspec-rails',
- :git => 'git://github.com/dchelimsky/rspec-rails.git'
-
-generate("rspec")
# get all datamapper related gems (assume sqlite3 to be database)
gem "addressable", :lib => "addressable/uri"
-gem "data_objects"
gem "do_sqlite3"
-gem "dm-core"
-gem "rails_datamapper"
+gem 'dm-validations'
+gem 'dm-timestamps'
+gem "rspec", :lib => false
+gem "rspec-rails", :lib => false
+gem "datamapper4rail", :lib => 'datamapper4rails' # excuse the typo
rake "gems:install"
+# have specs
+generate("rspec")
+
# install datamapper rake tasks
-generate("dm-install")
+generate("dm_install")
-# fix config/environment.rb to work with datamapper instead of active_record
-run "sed -i config/environment.rb -e 's/#.*config.plugins.*/config.plugins = [ :rails_datamapper, :all ]/'"
+# fix config files to work with datamapper instead of active_record
run "sed -i config/environment.rb -e 's/#.*config.frameworks.*/config.frameworks -= [ :active_record ]/'"
+run "sed -i spec/spec_helper.rb -e 's/^\\s*config[.]/#\\0/'"
+run "sed -i test/test_helper.rb -e 's/^[^#]*fixtures/#\\0/'"
+
+# fix a problem with missing class constants for models woth relations
+initializer 'preload_models.rb', <<-CODE
+require 'datamapper4rails/preload_models'
+CODE
# set up git
git :init

0 comments on commit 939a0f5

Please sign in to comment.
Something went wrong with that request. Please try again.