Different id_field


#1

Hi,
In my table there is no id field,i.e. I have the field with the name
id_host
then how to use that field in my application without changing the field
name.


#2

Hi,

On Apr 3, 2009, at 10:12 AM, Sushrut S. wrote:

Hi,
In my table there is no id field,i.e. I have the field with the name
id_host
then how to use that field in my application without changing the
field
name.

Assuming you mean Rails, you may have better luck next time asking on
their list. Try this:

class ModelName < ActiveRecord::Base
set_primary_key “id_host”
end

  • Stephen