Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Add an API for querying what ORM is being used

#5558

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.

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

State: invalid
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. David Chelimsky
    David Chelimsky

    José and I discussed this a bit and agree that this does not add value that can't be achieved in other ways. Please feel free to close.

    November 22nd, 2010 @ 02:08 PM

  2. José Valim
    José Valim
    • State changed from new to resolved
    • Importance changed from to Low

    November 22nd, 2010 @ 02:13 PM

  3. José Valim
    José Valim
    • State changed from resolved to invalid

    November 22nd, 2010 @ 02:40 PM