title: How can an ActiveRecord::Relation object call class methods
body: <p>How can an ActiveRecord::Relation object call class methods?</p>
  
  <pre><code>class Project &lt; ActiveRecord::Base
    has_many :tasks
  end
  
  class Task &lt; ActiveRecord::Base
    belongs_to :project
  
    def self.initial_tasks # class methods
     # here return initial tasks
    end
  end
  </code></pre>
  
  <p>Now we can call :</p>
  
  <pre><code>Project.first.tasks.initial_tasks # how it works
  </code></pre>
  
  <p><code>initial_tasks</code> is a class method and we can't call class methods on an object.</p>
  
  <p><code>Project.first.tasks</code> returns an ActiveRecord::Relation object, so how could it be able to  call <code>initial_tasks</code>?</p>
  
  <p>Please explain.</p>