This project is archived and is in readonly mode.

#3762 ✓resolved
ravinggenius

Specifying different ORM is non-obvious

Reported by ravinggenius | January 21st, 2010 @ 04:06 AM

I'm sorry if this shouldn't be posted here, but I'm not sure where else I should post this....

When creating a new Rails application with --dev -OJ, there doesn't seem to be an obvious way to tell Rails to use DataMapper. Or rather I set it (in config/application.rb), but ./script/generate model doesn't recognize it. In the config.generators block, I have set g.orm to :datamapper, :data_mapper, :data-mapper and even :dm, yet every time I run ./script/generate model, it only says error <whatever> [not found]. I get the same thing when I pass --orm directly to the generator command. I am assuming I am doing things correctly and that Rails just isn't ready for model agnosticism. If that is the case, please disregard this ticket. If it should be working, where can I find the documentation that config/application.rb refers to? I tried looking through the source, but I'm not familiar enough with the internal structure of Rails to know exactly where to look. I'd really like to continue playing with Rails 3, I'm stuck until DataMapper works.

Comments and changes to this ticket

  • Martin Gamsjaeger (snusnu)

    Martin Gamsjaeger (snusnu) January 26th, 2010 @ 03:42 AM

    • Tag changed from activemodel, rails3 to activemodel, datamapper, rails3

    Hey,

    Have a look at the following to get dm to run with rails3:

    http://github.com/dkubb/rails3_datamapper
    http://github.com/snusnu/datamapper_on_rails3
    http://github.com/snusnu/dm-core/tree/active_support
    http://github.com/snusnu/dm-more/tree/active_support

    First you will need to install dm-core and your desired dm-more plugins from the active_support branches in my forks. Then you need to install rails3_datamapper and have a look at the sample app.

    It works fine for me! My patches to make dm-core and dm-more compatible with active_support will be pulled into upstream datamapper repos sooner or later, then it won't be necessary to install dm-core and dm-more from my fork anymore.

    If you have any questions, feel free to ping me in #datamapper, the various rails channels on irc.freenode.net or on github. I'm snusnu everywhere :)

  • Mike Riley

    Mike Riley June 17th, 2010 @ 02:19 AM

    • State changed from “new” to “resolved”

    Hello ravinggenius,

    Looks like Martin replied to your issue with a valid solution, so I am going to mark this as resolved. If you need further assistance I'd hit Martin up in one of the suggested ways he mentioned. By all means if you come across any bugs or any issues specific to Rails on this, please let us know so we can get it fixed.

    thanks
    Mike Riley
    twitter.com/wdperson

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages