title: LoadError - Expected to define. Rails error when calling module
body: <p>I have a module called EntityTrackerHelper. Here is the code:</p>
  
  <pre><code>module EntityTrackerHelper
      def self.createUserAction(user_id, type, entity_id)
          existingua = UserAction.find(:first, :conditions=&gt; ["user_id = ? and type = ? and entity_id=?", user_id, type, entity_id])
          if existingua.nil?
              ua = UserAction.new
              ua.user_id = user_id
              ua.type = type
              ua.entity_id = entity_id
              ua.date = Time.now
              ua.save
          else
              existingua.date = Time.now
              existingua.save
          end
      end
  end
  </code></pre>
  
  <p>It is used to track changes and user access in an entity.
  It is used in a controller as follows.</p>
  
  <pre><code>require "#{Rails.root}/lib/EntityTrackerHelper"
  class LessonSectionsController &lt; InheritedResources::Base
      def index
        user_id = params[:user_id]
        lesson_id = params[:lesson_id]
        EntityTrackerHelper::createUserAction(user_id, 'LESSON', lesson_id)
        lessonSections = LessonSection.find(:all, :conditions =&gt; { :lesson_id =&gt; params[:lesson_id] })
        render :json =&gt; {:sections =&gt; lessonSections.as_json({:only =&gt; [:lesson_id,:id,:name]}), :error =&gt; ''}
      end
  end
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>LoadError (Expected /&lt;ProjPath&gt;/&lt;ProjName&gt;/app/models/lesson.rb to define LESSON):
    lib/EntityTrackerHelper.rb:12:in `createUserAction'
    app/controllers/lesson_sections_controller.rb:9:in `index'
  </code></pre>
  
  <p>Line 12 in <code>EntityTrackerHelper</code> is <code>UserAction.find...</code></p>
  
  <p>Any idea?</p>
  
  <p>Thanks</p>