You can add the class name and foreign key to the belongs_to association.
class User < ActiveRecord::Base attr_accessible :email, :password, :password_confirmation, :remember_me, :first_name, :last_name, :shipping_address_id; :billing_address_id belongs_to :billing_address, class_name: :Address, foreign_key: :billing_address_id belongs_to :shipping_address, class_name: :Address, foreign_key: :shipping_address_id end
Then you can access addresses like
user.billing_address user.shipping_address
source share