title: NoMethodError in EventsController#index | undefined method `has_reputation' for [rails4]
body: <p>i am new to rails - so any help will be much appreciated. i am currently using the GEM 'twitter/activerecord-reputation-system' and following the rails tutorial #364 on rails cast.</p>
  
  <ol>
  <li><p>i am unsure why i am getting the error as i thought the has_reputation method should be already automatically defined within the GEM</p></li>
  <li><p>I have also restarted my console/terminal but still get the same error. Any help will be much appreciated</p></li>
  </ol>
  
  <p><strong>my error:</strong> #undefined method `has_reputation' for #</p>
  
  <pre><code>Started GET "/events" for 127.0.0.1 at 2014-08-21 10:37:36 +0100
  Processing by EventsController#index as HTML
    User Load (1.1ms)  SELECT  "users".* FROM "users"  WHERE "users"."id" = 1  ORDER BY "users"."id" ASC LIMIT 1
  Completed 500 Internal Server Error in 9ms
  
  NoMethodError (undefined method `has_reputation' for #&lt;Class:0x007f87cb9efed0&gt;):
    app/models/event.rb:5:in `&lt;class:Event&gt;'
    app/models/event.rb:1:in `&lt;top (required)&gt;'
    app/controllers/events_controller.rb:8:in `index'
  
  
    Rendered /Users/ARTLoe/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.6ms)
    Rendered /Users/ARTLoe/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.2ms)
    Rendered /Users/ARTLoe/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.9ms)
    Rendered /Users/ARTLoe/.rvm/gems/ruby-2.1.2/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (11.9ms)
  </code></pre>
  
  <p><strong>models</strong></p>
  
  <pre><code>#event model
  class Event &lt; ActiveRecord::Base
    belongs_to :user
    has_many :comments, as: :commentable
  
    has_reputation :votes, source: :user, aggregated_by: :sum
  
    validates :city, :date, :description, :name, :price, :time, presence: true
    validates :price, numericality: {greater_than_or_equal_to: 0.01}
    validates :name, length: { minimum: 5 }
    validates :name, length: { maximum: 22 }
    validates :user_id, presence: true
  end
  
  #user model
  class User &lt; ActiveRecord::Base
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable
  
    has_many :events, dependent: :destroy
    has_many :comments, as: :commentable, dependent: :destroy
  
    has_many :relationships, foreign_key: "follower_id", dependent: :destroy
    has_many :followed_users, through: :relationships, source: :followed
  
    has_many :reverse_relationships, foreign_key: "followed_id", class_name: "Relationship", dependent: :destroy
    has_many :followers, through: :reverse_relationships, source: :follower
  
    validates_presence_of :firstname, :lastname
  end
  </code></pre>
  
  <p><strong>route</strong></p>
  
  <pre><code>Rails.application.routes.draw do
  
    devise_for :users
    get '/about', to: 'static_pages#about'
    get '/help', to: 'static_pages#help'
    get '/terms', to: 'static_pages#terms'
    get '/policy', to: 'static_pages#policy'
    get '/contact', to: 'static_pages#contact'
    get '/blabber', to: 'static_pages#blabber_public'
  
    resources :users do
      member do
        get :following, :followers
      end
    end
  
    resources :events do 
      resources :comments, only: [:create, :destroy]
      member { post :vote }
    end
  
    root to: 'home#index', as: 'home'
  
    resources :relationships, only: [:create, :destroy]
  end
  </code></pre>
  
  <p><strong>schema</strong></p>
  
  <pre><code>ActiveRecord::Schema.define(version: 20140820114256) do
  
    # These are extensions that must be enabled in order to support this database
    enable_extension "plpgsql"
  
    create_table "comments", force: true do |t|
      t.text     "content"
      t.integer  "commentable_id"
      t.string   "commentable_type"
      t.integer  "user_id"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    add_index "comments", ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type", using: :btree
  
    create_table "events", force: true do |t|
      t.string   "name"
      t.text     "description"
      t.date     "date"
      t.time     "time"
      t.text     "city"
      t.decimal  "price",       precision: 8, scale: 2
      t.datetime "created_at"
      t.datetime "updated_at"
      t.integer  "user_id"
    end
  
    create_table "relationships", force: true do |t|
      t.integer  "follower_id"
      t.integer  "followed_id"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    add_index "relationships", ["followed_id"], name: "index_relationships_on_followed_id", using: :btree
    add_index "relationships", ["follower_id", "followed_id"], name: "index_relationships_on_follower_id_and_followed_id", unique: true, using: :btree
    add_index "relationships", ["follower_id"], name: "index_relationships_on_follower_id", using: :btree
  
    create_table "rs_evaluations", force: true do |t|
      t.string   "reputation_name"
      t.integer  "source_id"
      t.string   "source_type"
      t.integer  "target_id"
      t.string   "target_type"
      t.float    "value",           default: 0.0
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    add_index "rs_evaluations", ["reputation_name"], name: "index_rs_evaluations_on_reputation_name", using: :btree
    add_index "rs_evaluations", ["source_id", "source_type"], name: "index_rs_evaluations_on_source_id_and_source_type", using: :btree
    add_index "rs_evaluations", ["target_id", "target_type"], name: "index_rs_evaluations_on_target_id_and_target_type", using: :btree
  
    create_table "rs_reputation_messages", force: true do |t|
      t.integer  "sender_id"
      t.string   "sender_type"
      t.integer  "receiver_id"
      t.float    "weight",      default: 1.0
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    add_index "rs_reputation_messages", ["receiver_id"], name: "index_rs_reputation_messages_on_receiver_id", using: :btree
    add_index "rs_reputation_messages", ["sender_id", "sender_type"], name: "index_rs_reputation_messages_on_sender_id_and_sender_type", using: :btree
  
    create_table "rs_reputations", force: true do |t|
      t.string   "reputation_name"
      t.float    "value",           default: 0.0
      t.string   "aggregated_by"
      t.integer  "target_id"
      t.string   "target_type"
      t.boolean  "active",          default: true
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    add_index "rs_reputations", ["reputation_name"], name: "index_rs_reputations_on_reputation_name", using: :btree
    add_index "rs_reputations", ["target_id", "target_type"], name: "index_rs_reputations_on_target_id_and_target_type", using: :btree
  
    create_table "users", force: true do |t|
      t.string   "email",                  default: "", null: false
      t.string   "encrypted_password",     default: "", null: false
      t.string   "reset_password_token"
      t.datetime "reset_password_sent_at"
      t.datetime "remember_created_at"
      t.integer  "sign_in_count",          default: 0,  null: false
      t.datetime "current_sign_in_at"
      t.datetime "last_sign_in_at"
      t.string   "current_sign_in_ip"
      t.string   "last_sign_in_ip"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.string   "firstname"
      t.string   "lastname"
      t.date     "dob"
      t.string   "gender"
      t.text     "description"
      t.string   "role"
    end
  
    add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
    add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
  
  end
  </code></pre>
  
  <p><strong>events_controller</strong></p>
  
  <pre><code>class EventsController &lt; ApplicationController
    before_action :set_event, only: [:show, :edit, :update, :destroy]
    before_filter :authenticate_user!
  
    def index
      @events = Event.order(:date)
      # @events = current_user.events | displays only events by current user
    end
  
    def show
      @commentable = @event
      @comments = @commentable.comments
      @comment = Comment.new
    end
  
    def new
      @event = Event.new
    end
  
    def edit
    end
  
    def create
      @event = Event.new(event_params)
      @event.user = current_user
  
      respond_to do |format|
        if @event.save
          format.html { redirect_to @event, notice: 'Event was successfully created.' }
          format.json { render :show, status: :created, location: @event }
        else
          format.html { render :new }
          format.json { render json: @event.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # PATCH/PUT /events/1
    # PATCH/PUT /events/1.json
    def update
      respond_to do |format|
        if @event.update(event_params)
          format.html { redirect_to @event, notice: 'Event was successfully updated.' }
          format.json { render :show, status: :ok, location: @event }
        else
          format.html { render :edit }
          format.json { render json: @event.errors, status: :unprocessable_entity }
        end
      end
    end
  
    def destroy
      @event.destroy
      respond_to do |format|
        format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }
        format.json { head :no_content }
      end
    end
  
    def vote
      value = params[:type] == "up" ? 1 : -1
      @event = Event.find(params[:id])
      @event.add_or_update_evaluation(:votes, value, current_user)
      redirect_to :back, notice: "Thank you for voting"
    end
  
    private
      # Use callbacks to share common setup or constraints between actions.
      def set_event
        @event = Event.find(params[:id])
      end
  
      # Never trust parameters from the scary internet, only allow the white list through.
      def event_params
        params.require(:event).permit(:name, :description, :date, :time, :city, :price, :user_id)
      end
  end
  </code></pre>
  
  <p>Gemfile</p>
  
  <pre><code>source 'https://rubygems.org'
  
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '4.1.1'
  # Use postgresql as the database for Active Record
  gem 'pg'
  gem 'ancestry'
  gem 'acts_as_votable'
  gem 'acts_as_list'
  gem 'acts_as_commentable', '3.0.1'
  gem 'best_in_place'
  gem 'carrierwave', '=0.9.0'
  gem 'cancan'
  gem 'devise'
  gem 'fancybox-rails'
  gem 'font-awesome-rails'
  gem 'jquery-ui-rails'
  gem 'kaminari'
  gem 'letter_opener'
  gem 'ransack'
  # gem 'rmagick'
  gem 'thumbs_up'
  gem 'simple_form'
  gem 'activerecord-reputation-system', github: 'NARKOZ/activerecord-reputation-system'
  gem 'quiet_assets', group: :development
  etc....
  </code></pre>