On Sep 3, 12:14 pm, Hassan Schroeder <[email protected]>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to