Displaying 1 result from an estimated 1 matches for "nonstandardish_id".
2012 Nov 19
0
has_one :through NoMethodError: undefined method `klass' for nil:NilClass when doing class_name on reflection
...cript/rails:6:in `require''
from script/rails:6:in `<main>''
Simplified versions of models:
class MyModel < ActiveRecord::Base
has_one :bar, through: :foo
end
class Foo < ActiveRecord::Base
self.table_name = :somenonstandardnamehere
self.primary_key = :nonstandardish_id
# ...
has_one :bar, foreign_key: ''anothernonstandard_id''
end
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/...