Rails Autoloading is what happens in the background that most developers don’t even think about. Rails Autoload is something that is important for you to know about. Rails will automatically load certain files your Rails app application when it boots up.
N+1 queries need to be solved in Ruby on Rails by identifying where the Active Relation object is created and adding a joins or includes to prefetch eagerload to optimize ActiveRecord just-in-time loading.
A post about upgrading from Rails 2 to Rails 3, 3.1, or 3.2