Vaibhav Deshpande
2009-Apr-03 15:44 UTC
connecting model class to different column name other tn id
wrote: I am using the allready created tables in oracle and connecting to the ruby on rails model class, i used ''set_table_name ''table name'' '' and it gets connected but, i want to access its records and it has different id field name as field_id, i want to access its record making field_id field as my id field so that i can access its records but i dont want to rename field_id to id sence, it has laks of records and my company is using those records can any one sugust me the way to connect the model to field_id column...plz help Thanks in advance... with regards, vaibhav -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Siddick Ebramsha
2009-Apr-04 04:23 UTC
Re: connecting model class to different column name other tn id
Use the set_primary_key method. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vaibhav Deshpande
2009-Apr-04 09:10 UTC
Re: connecting model class to different column name other tn
Siddick Ebramsha wrote:> Use the set_primary_key method.I used this method as follows class Item < ActiveRecord::Base set_table_name ''item'' set_primary_key ''id_field'' end and now its working properly, Thanks you, for your good response!!!!!! Keep responding me..... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---