create_table "users", options do |t| t.column "nickname", :string t.column "created_at", :datetime end create_table "friends", options do |t| t.column "my_id", :integer t.column "friend_id", :integer t.column "created_at", :datetime end class Friend < ActiveRecord::Base belongs_to :friend_shipped, :foreign_key=>:friend_id, :class_name => "User" belongs_to :befriend_shipped, :foreign_key=>:my_id, :