title: Relationship issue with activerecord rails
body: <p>I am still learning Rails, I've read some books and did some hands on at codeschool.com and now I'm trying to write my first simple app from scratch.</p>
  
  <p>I'm using devise for authentication, but since i still kinda suck at rails, I haven't gotten email confirmation working so currently, for testing purposes only Admin users can take actions.</p>
  
  <p>Here are my models:</p>
  
  <pre><code>[loluser@fedora models]$ ls
  admin.rb  pet.rb  user.rb
  [loluser@fedora models]$ cat admin.rb 
  class Admin &lt; ActiveRecord::Base
      has_many    :pets 
      devise :database_authenticatable, :registerable, :timeoutable, :validatable,
           :timeout_in =&gt; 20.minutes
  end
  [loluser@fedora models]$ cat pet.rb 
  class pet &lt; ActiveRecord::Base
      belongs_to :admin
  end
  </code></pre>
  
  <p>[loluser@fedora models]$ </p>
  
  <p>In my controller, I want to display Admin[1]'s pets in the index  so i have this code:</p>
  
  <pre><code>  class petsController &lt; ApplicationController
    before_filter :authenticate_admin!
    # GET /pets
    # GET /pets.xml
    def index
      admin=Admin.find(1)
      @pets = pet.admin.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.xml  { render :xml =&gt; @pets }
      end
    end
  </code></pre>
  
  <p>However, I am getting this error:</p>
  
  <pre><code>NoMethodError in petsController#index
  
  undefined method `admin' for #&lt;Class:0x7f2daa7b0258&gt;
  
  Rails.root: /home/loluser/dev/app2/devise_example
  Application Trace | Framework Trace | Full Trace
  
  app/controllers/pets_controller.rb:7:in `index'
  </code></pre>
  
  <p>Help will be appreciated and please let me know if I need to clarify something.</p>
  
  <p>Thanks in advance.</p>