title: Could not find the source association(s) :character in model Relation
body: <p>I have two models called User and Relations. Relation stores the relationships between users, and there are different types of relationships. At the moment, I am trying to implement two types: friends and friend requests.</p>
  
  <p>Here are my class associations:</p>
  
  <pre><code>class Relation &lt; ActiveRecord::Base
    belongs_to :owner, class_name: "User"
    validates :owner, presence: true
    validates :character, presence: true
  end
  
  class User &lt; ActiveRecord::Base
  
    has_many :characters, dependent: :destroy
    has_many :relations, foreign_key: "owner", dependent: :destroy
    has_many :friends, -&gt; { where reltype: "friend" }, through: :relations, source: "character"
  
    has_many :reverse_relations, foreign_key: "character", class_name: "Relation", dependent: :destroy
    has_many :friend_requests, -&gt; { where reltype: "freq" }, through: :reverse_relations, source: :owner
  
    .
    .
    .
  end
  </code></pre>
  
  <p>In IRB, I am trying to use the User.friends array this is supposed to generate, and this error is thrown:</p>
  
  <pre><code>Loading development environment (Rails 4.0.0)
  irb(main):001:0&gt; user = User.find(1)
    User Load (12.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 1]]
  =&gt; #&lt;User id: 1, name: "melv", email: "melv@mx.org", password_digest: "$2a$10$g3FjyVP9ya/L.j1iWAzYH.YFOjYOyxUGp3KIt6ajic
  Jf...", verified: nil, reg_ip: nil, last_ip: nil, character_limit: 3, characters: nil, created_at: "2013-10-31 19:10:36"
  , updated_at: "2013-11-02 11:05:14", remember_token: "4e883d6ec84b5c142882cc084c14bc101a06350f", playchar: 0&gt;
  irb(main):002:0&gt; user.friends
  ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :character in model
   Relation. Try 'has_many :friends, :through =&gt; :relations, :source =&gt; &lt;name&gt;'. Is it one of :owner?
          &lt;...stack trace...&gt;
  irb(main):003:0&gt;
  </code></pre>
  
  <p>Am I doing something wrong?</p>
  
  <p><hr>
  My schema, as requested:</p>
  
  <pre><code>ActiveRecord::Schema.define(version: 20131102102750) do
  
    # These are extensions that must be enabled in order to support this database
    enable_extension "plpgsql"
  
    create_table "characters", force: true do |t|
      t.integer  "accountid"
      t.string   "username"
      t.integer  "roundles"
      t.integer  "gems"
      t.integer  "rank"
      t.integer  "tier"
      t.datetime "tiertime"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    create_table "permission_ranks", force: true do |t|
      t.string   "label"
      t.integer  "badge"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    create_table "relations", force: true do |t|
      t.integer  "owner"
      t.integer  "character"
      t.string   "reltype"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    add_index "relations", ["character"], name: "index_relations_on_character", using: :btree
    add_index "relations", ["owner", "character"], name: "index_relations_on_owner_and_character", unique: true, using: :btree
    add_index "relations", ["owner"], name: "index_relations_on_owner", using: :btree
  
    create_table "tickets", force: true do |t|
      t.string   "title"
      t.text     "desc"
      t.integer  "sender"
      t.integer  "assigned"
      t.text     "addinfo"
      t.datetime "created_at"
      t.datetime "updated_at"
    end
  
    create_table "users", force: true do |t|
      t.string   "name"
      t.string   "email"
      t.string   "password_digest"
      t.boolean  "verified"
      t.string   "reg_ip"
      t.string   "last_ip"
      t.integer  "character_limit"
      t.integer  "characters"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.string   "remember_token"
      t.integer  "playchar"
    end
  
    add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
    add_index "users", ["name"], name: "index_users_on_name", unique: true, using: :btree
    add_index "users", ["remember_token"], name: "index_users_on_remember_token", using: :btree
  
  end
  </code></pre>