title: Vanity gem is throwing an error on my User model
body: <p>I followed the instructions for the gem perfectly - <a href="https://github.com/jaustinhughey/vanities" rel="nofollow">https://github.com/jaustinhughey/vanities</a> - and everything else worked fine.</p>
  
  <p>But when I tried to load my main page, I am getting this error:</p>
  
  <pre><code>NameError in HomeController#index
  
  undefined local variable or method `has_vanity' for #&lt;Class:0x000001015691e8&gt;
  app/models/user.rb:2:in `&lt;class:User&gt;'
  app/models/user.rb:1:in `&lt;top (required)&gt;'
  app/controllers/home_controller.rb:3:in `index'
  </code></pre>
  
  <p>Here is my <code>User.rb</code></p>
  
  <pre><code>class User &lt; ActiveRecord::Base
          has_vanity
  
          has_many :feedbacks_as_poster, :foreign_key =&gt; :poster_id, :class_name =&gt; 'Feedback'
        has_many :feedbacks_as_receiver, :foreign_key =&gt; :receiver_id, :class_name =&gt; 'Feedback'
  
  
  end
  # == Schema Information
  #
  # Table name: users
  #
  #  id         :integer         not null, primary key
  #  email      :string(255)
  #  f_name     :string(255)
  #  l_name     :string(255)
  #  username   :string(255)
  #  role_id    :integer
  #  picture    :string(255)
  #  about_me   :string(255)
  #  website    :string(255)
  #  created_at :datetime
  #  updated_at :datetime
  #
  </code></pre>
  
  <p>And here is my <code>Home Controller</code></p>
  
  <pre><code>class HomeController &lt; ApplicationController
    def index
          @users = User.all
          @feedback = Feedback.new
    end
  
  end
  </code></pre>
  
  <p>Thoughts?</p>
  
  <p>Edit 1: See my <code>Gemfile</code> below:</p>
  
  <pre><code>source 'http://rubygems.org'
  
  gem 'rails', '3.1.0'
  
  gem 'execjs'
  gem 'therubyracer'
  gem 'vanities'
  
  group :assets do
    gem 'sass-rails', "  ~&gt; 3.1.0"
    gem 'coffee-rails', "~&gt; 3.1.0"
    gem 'uglifier'
  end
  
  gem 'jquery-rails'    
  
  group :development do
      gem 'sqlite3'
      gem 'annotate', :git =&gt; 'git://github.com/ctran/annotate_models.git'
  end
  
  group :test do
    gem 'turn', :require =&gt; false
  end
  
  group :production do    
      gem 'pg', :require =&gt; 'pg'
  end
  </code></pre>
  
  <p>Edit 2: If I go to the URL profile of a user I have created, e.g. <code>localhost:3000/test</code> I see the following error, which leads me to believe that part of the gem is working because it actually fetches the correct record. But something else is broken.</p>
  
  <pre><code>Started GET "/test" for 127.0.0.1 at 2011-09-07 20:00:19 -0500
    Processing by VanitiesController#show as HTML
    Parameters: {"vname"=&gt;"test"}
    Vanity Load (0.2ms)  SELECT "vanities".* FROM "vanities" WHERE "vanities"."name" = 'test' LIMIT 1
  Completed 500 Internal Server Error in 100ms
  
  NameError (undefined local variable or method `has_vanity' for #&lt;Class:0x0000010313d478&gt;):
    app/models/user.rb:2:in `&lt;class:User&gt;'
    app/models/user.rb:1:in `&lt;top (required)&gt;'
    app/controllers/vanities_controller.rb:8:in `show'
  </code></pre>