Two foreign keys in model pointing at same table issue

I think the problem is that the association name is the same as the foreign key name. When populating the select, normally you would look at foo_id to see which Foo should be the selected one. However in your case sending nationality_id to an instance of Student returns a GlCountry object, not an id. Similarly the form stuff will be trying to set nationality_id to be the id of the chosen object, but since nationality_id is actually the association that will break too.

You should probably change it to this:

class StStudent < ActiveRecord::Base
   belongs_to :nationality, :class_name => "GlCountry", :foreign_key
=> "nationality_id"
   belongs_to :current_location, :class_name => "GlCountry",
:foreign_key => "current_location_id"
end

Fred