title: Easing the pain of transition to Rails 4
body: <p>I am working on a Rails 3.2 application now, but I am aware that Rails 4 is just around the corner.
  What are the things I should be aware of now when implementing my application to make it easier to migrate to Rails 4 when it is formally released or perhaps after the couple of point releases?
  I know that some of the functionality will be spun out into gems, but then there is no guarantee of support in Rails 4.1+.</p>
  
  <p>I have read the upgrade guide: <a href="http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0">http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0</a>, and the release notes: <a href="http://edgeguides.rubyonrails.org/4_0_release_notes.html">http://edgeguides.rubyonrails.org/4_0_release_notes.html</a>.</p>
  
  <p>I am more interested in this point to identify the gotchas that would cause me headaches in an upgrade, rather than the nice new shiny features of Rails 4.</p>
  
  <p>So based on this reading and snippets from the Internet, what I have at the moment is:</p>
  
  <ul>
  <li>Upgrade to Ruby 1.9.3 at a minimum.</li>
  <li>Don't use plugins - use gems instead.</li>
  <li>ActiveRecord::IdentityMap will not be in Rails 4.</li>
  <li>ActiveResource will not be part of core Rails 4, but will be in a separate gem (<a href="https://github.com/rails/activeresource">activeresource</a>). Possibly consider other ORMs for REST APIs.</li>
  <li>Do not use Dynamic Finder Methods in ActiveRecord like <code>find_all_by_*</code> or <code>scoped_by_*</code> as these will be deprecated. Use <code>where</code> instead.</li>
  <li>Avoid Hash-based Finders: e.g. <code>User.find(:all, :conditions =&gt; ...</code> and use <code>where</code> instead.</li>
  <li>Eager Evaluated Scope in ActiveRecord: scope will require a lambda. E.g. use <code>scope :red, -&gt; { where(color: 'red') }</code> not <code>scope :red, where(color: 'red')</code>.</li>
  <li>ActiveRecord::SessionStore will now be a separate gem (<code>activerecord-session_store</code>).</li>
  <li>Use ActiveSupport::Logger instead of BufferedLogger.</li>
  <li>Start using the <a href="https://github.com/rails/strong_parameters">strong_parameters</a> gem in anticipation of Strong Parameters in Rails 4.  Instead of attr_accessor, attr_accessible, attr_protected at the ActiveRecord level, this involves putting <code>params.require</code> into the controller to force the correct parameters to be supplied.</li>
  </ul>
  
  <p>...but I'm sure there is more. Could anyone provide a comprehensive but common-sense list to be aware of? I'm not looking for a full list of deprecations in Rails 4 - it's the big things to be aware of and what I can do now to future-proof for them.</p>