[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

different id_field

Sushrut Sathe

4/3/2009 3:13:00 PM

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.
--
Posted via http://www.ruby-....

1 Answer

Stephen Celis

4/3/2009 10:44:00 PM

0

Hi,

On Apr 3, 2009, at 10:12 AM, Sushrut Sathe 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