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
# Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros | |
# Forked from https://gist.github.com/ecleel/3dc89a753bac6a54bf8d170f63256f19 | |
# | |
# Optimized version which uses to_yaml for content creation and checks | |
# that models are ActiveRecord::Base models and not abstract class before trying to fetch | |
# them from database. | |
# | |
# Also supports nested resources and namespaces them correctly | |
# | |
# Tested in Rails 6.0.0 |