title: Splitting a class into multiple files in Ruby on Rails
body: <p>I'm trying to split a large model into multiple files for logical organization.  So i have two files:</p>
  
  <p>model1.rb</p>
  
  <pre><code>class Model1 &lt; ActiveRecord::Base
    before_destroy :destroying
    has_many :things, :dependent=&gt;:destroy
  
    def method1
      ...
    end
    def method2
      ...
    end
  
  end
  require 'model1_section1'
  </code></pre>
  
  <p>model1_section1.rb</p>
  
  <pre><code>class Model1
    def method3
      ...
    end
    def self.class_method4
      ...
    end
  end
  </code></pre>
  
  <p>but when the app loads, and there is a call to Model1.class_method4, i get:</p>
  
  <pre><code>undefined method `class_method4' for #&lt;Class:0x92534d0&gt;
  </code></pre>
  
  <p>i've also tried this for the require:</p>
  
  <pre><code>require File.join(File.dirname(__FILE__), 'model1_section1')
  </code></pre>
  
  <p>What am i doing wrong here?</p>