Ruby on Rails Friday, September 3, 2010

On Sep 3, 12:14 pm, Hassan Schroeder <hassan.schroe...@gmail.com>
wrote:
> Create a model based on an existing table e.g. "things", as in
>
>  class Thing < ActiveRecord::Base
>  end
>

Odds are, you will need to tell Rails what the primary key of your
legacy table is, unless it happens to be "id"

class Thing < ActiveRecord::Base
set_primary_key "[PKFieldName]"
end

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment