使用Rails 3.2设置dm-rails?

时间:2012-01-21 23:06:45

标签: ruby-datamapper ruby-on-rails-3.2

如何让dm-rails与其他Rails 3.2堆栈一起运行?

2 个答案:

答案 0 :(得分:3)

DM 1.3 beta似乎适用于3.2.1,至少对于demo dm_rails应用程序而言。

我必须在config / environments / development.rb

中注释掉两个“active_record”行

要更新到1.3 beta,我删除了我的Gemfile.lock文件,为每个dm gem(下面)指定了git存储库,然后运行了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'

之后,示例项目运行良好。

答案 1 :(得分:0)

在DataMapper 1.3准备好ActiveReload支持之前,您可以将以下内容添加到 config / environments / development.rb 中,以便继续以旧方式重新加载模型:

config.reload_classes_only_on_change = false