title: uninitialized constant ActiveResource::ResourceNotFound
body: <p>I'm using Rails 3.2.3 with ActiveResource.
  I have an issue in production that says:</p>
  
  <pre><code>ActiveResource::ResourceNotFound: Failed. Response code = 404. Response message = Not Found.
  </code></pre>
  
  <p>So I tried to treat it the same way I treat <code>ActiveRecord::RecordNotFound</code>:</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
    protect_from_forgery
  
    rescue_from ActiveRecord::RecordNotFound do |e|
      render_404
    end
  
    rescue_from ActiveResource::ResourceNotFound do |e|
      render_404
    end
  
    def render_404
      respond_to do |type|
        type.html { render template: 'shared/404_not_found', layout: 'application', status: '404 Not Found' }
        type.all  { render nothing: true, status: '404 Not Found' }
      end
    end
  end
  </code></pre>
  
  <p>But now, when I deploy, I get an error telling me that:</p>
  
  <pre><code>/apps/com.example/shared/bundle/ruby/1.9.1/gems/activeadmin-0.4.3/lib/active_admin/namespace.rb:191:in `eval': uninitialized constant ActiveResource::ResourceNotFound (NameError)
  </code></pre>
  
  <p>I don't really get it. I tried with a <code>if defined?(ActiveResource::ResourceNotFound)</code> but then it falls back to the previous behavior.</p>
  
  <p>Any idea of how to treat this issue ?</p>
  
  <p>Thanks !</p>
  
  <p><strong>EDIT:</strong> For the moment I used the following code but I'm not really happy with it.</p>
  
  <pre><code>rescue_from Exception do |e|
    e.is_a?(ActiveResource::ResourceNotFound) ? render_404 : raise
  end
  </code></pre>