Question

How can I get dm-rails to play well with the rest of the Rails 3.2 stack?

Was it helpful?

Solution

The DM 1.3 beta seems to work with 3.2.1, at least for the demo dm_rails app.

I had to comment out two "active_record" lines in config/environments/development.rb

To update to the 1.3 beta I deleted my Gemfile.lock file, specified the git repository for each dm gem (below), and then ran a bundle install.

gem 'dm-core', git: 'https://github.com/datamapper/dm-core'
gem 'dm-active_model', git: 'https://github.com/datamapper/dm-active_model.git'
gem 'dm-validations', git: 'https://github.com/datamapper/dm-validations.git'
gem 'dm-rails', git: 'https://github.com/datamapper/dm-rails.git'
gem 'dm-migrations', git: 'https://github.com/datamapper/dm-migrations'
gem 'dm-types', git: 'https://github.com/datamapper/dm-types'
gem 'dm-constraints', git: 'https://github.com/datamapper/dm-constraints'
gem 'dm-transactions', git: 'https://github.com/datamapper/dm-transactions'
gem 'dm-aggregates', git: 'https://github.com/datamapper/dm-aggregates'
gem 'dm-timestamps', git: 'https://github.com/datamapper/dm-timestamps'
gem 'dm-observer', git: 'https://github.com/datamapper/dm-observer'


gem 'dm-do-adapter', git: 'https://github.com/datamapper/dm-do-adapter'
gem 'dm-sqlite-adapter', git: 'https://github.com/datamapper/dm-sqlite-adapter'

After that, the sample project worked fine.

OTHER TIPS

Until DataMapper 1.3 is ready with ActiveReload support, you can add the following to your config/environments/development.rb to keep reloading the models the old way:

config.reload_classes_only_on_change = false
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top