Chaining the hell out of ActiveRecord models

So, you want a quick and dirty way to obtain all the models in your Rails app that contain relations targeting a collection (like an has_many relation)?

  .map {|model| File.basename(model, '.rb')}
  .select {|section|
    section.reflections.find {|name, reflection|

Demeter law?

You got served

kind of.. ^_^

Leave a Reply

Please Login to comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.