title: NoMethodError on Mongoid method call
body: <p>I am calling a class method of another model in my model and it seems to not find it.</p>
  
  <p><strong>Details</strong></p>
  
  <p><code>add_existing_items</code> is the instance method of <code>Category</code> from where I make a call to class method of Metadata and this fails with the error. </p>
  
  <pre><code>Caught exception : NoMethodError : undefined method `update_or_add_metadata' for Mongoid::Relations::Metadata:Class
  /Users/anil20787/workspace/repos/anil_reps/metadata_favorite/app/models/category.rb:36:in `block in add_existing_items'
  </code></pre>
  
  <p>This call to class method of <code>Metadata</code> works absolutely fine when I call it from my Category controller.</p>
  
  <p>Category model:</p>
  
  <pre><code>class Category
    include Mongoid::Document
  
    belongs_to :catalog
    has_many :category_items
  
    # fields go here
  
    # validations go here
  
    def add_existing_items(inputs)
      if inputs[:category_item_ids] &amp;&amp; inputs[:category_item_ids].kind_of?(Array)
        inputs[:category_item_ids].each do |category_item_id|
          category_item = CategoryItem.find(category_item_id)
          new_item = category_item.dup
          new_item.category = self
          new_item.save!
          # 'new_item' document gets saved successfully
          # But the below call to class method of another class fails! Why?
          Metadata.update_or_add_metadata(new_item, true)
        end
      end
    end
  end
  </code></pre>
  
  <p>Metadata model:</p>
  
  <pre><code>class Metadata
    include Mongoid::Document
    include Mongoid::Timestamps
  
    # fields go here
    # validations go here
    belongs_to :outlet
  
    # instance methods go here
  
    class &lt;&lt; self
      def update_or_add_metadata(item, create_new_boolean)
        # do the updating work
      end 
    end
  end
  </code></pre>
  
  <p>Why am I seeing this problem? How do I resolve this?</p>