This project is archived and is in readonly mode.

#5558 ✓invalid
David Chelimsky

Add an API for querying what ORM is being used

Reported by David Chelimsky | September 5th, 2010 @ 05:20 PM

Extension libraries sometimes need to know what ORM is being used in order to load the right code. We can't rely on defined?(:ActiveRecord) because users tend to leave the defaultrequire 'rails/all'inapplication.rband load their ORM of choice in addition toActiveRecord.

The info is available at Rails.configuration.generators.options[:rails][:orm], but that presents a few problems:

  • I'm not certain that there are any guarantees that this will be populated in a situation other than running generators.
  • The dependency on generators feels odd for a non-generator activity
  • Even with that, it's a long route to traverse to get to high level information

I'd propose adding an API for this like Rails.configuration.orm, or even Rails.orm. I'm happy to submit a patch for this, but would like to get a conversation going first.

Comments and changes to this ticket

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=""></a>