title: Accessing Instance Methods in a Rails AR Model Nested in a Module
body: <p>I am developing a gem that has an ActiveRecord model nested within a module like this:</p>
  
  <pre><code>module Fruit
    class Apple &lt; ActiveRecord::Base
      self.table_name = "weird_name_apples" # In case this is relevant
      ...
      def console_message
        puts "This should print a message to console."
      end
    end
  end
  </code></pre>
  
  <p>When I open up a console in a sample app that has the gem installed and run the following:</p>
  
  <pre><code>Fruit::Apple.first.console_message
  </code></pre>
  
  <p>It returns <code>undefined method 'console_message' for #&lt;Fruit::Apple:0x007fb58e19c48&gt;</code>.</p>
  
  <p>What's causing this error? In other apps, I can access instance methods from models just fine, but it's not in a gem nor using <code>table_name</code>, if that matters.</p>
  
  <p>Thanks in advance for any help!</p>