title: Circular dependency issue Rails 4
body: <p>So I have a file in the <code>lib</code> directory. At the top of that file, I include the following:</p>
  
  <pre><code>require File.expand_path('../../config/environment', __FILE__)
  </code></pre>
  
  <p>Whenever I include that require, I get the following error message:</p>
  
  <pre><code>Circular dependency detected while autoloading constant AdminUser (RuntimeError)
  </code></pre>
  
  <p>In context:</p>
  
  <pre><code>/Users/ahcarpenter/.rvm/gems/ruby-1.9.3-p448@global/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:461:in `load_missing_constant': Circular dependency detected while autoloading constant AdminUser (RuntimeError)
      from /Users/ahcarpenter/.rvm/gems/ruby-1.9.3-p448@global/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:184:in `const_missing'
      from /Users/ahcarpenter/Dropbox/workspace/Web Applications/main-site/app/admin/admin_user.rb:1:in `&lt;top (required)&gt;'
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>EDIT:</p>
  
  <p>Here's the definition of the AdminUser class as generated by <code>activeadmin</code>:</p>
  
  <pre><code>ActiveAdmin.register AdminUser do
    index do
      column :email
      column :current_sign_in_at
      column :last_sign_in_at
      column :sign_in_count
      default_actions
    end
  
    filter :email
  
    form do |f|
      f.inputs "Admin Details" do
        f.input :email
        f.input :password
        f.input :password_confirmation
      end
      f.actions
    end
    controller do
      def permitted_params
        params.permit admin_user: [:email, :password, :password_confirmation]
      end
    end
  end
  </code></pre>