- put these codes in Ruby on Rails application.
module AssociationsForIncludes
  # As follows or paste codes here.
  #require 'associations_for_includes'
end
ActiveRecord::Base.send(:extend, AssociationsForIncludes)- call the method from ActiveRecord model.
Hoge.associations_for_includes
不正な関連があるとエラーが出るので、それを検知するためにも使える