Created
July 5, 2013 14:00
-
-
Save elhoyos/5934722 to your computer and use it in GitHub Desktop.
Eager load resources to make the application model-inheritance-aware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Model.subclasses will give you an empty array | |
Rails.application.eager_load! | |
# Now you can do Model.subclasses and it will retrieve its descendants |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment