jeremyevans/sequel — Issue #399: Oracle primary keys and Model.db=
Author: jlandahl
Created: 2011-11-11 01:37:58+00:00
State: open

I've run across a strange situation when using Oracle model classes, set_primary_key, and `Model.db=`. The problem starts with commit d7113c479c2301127f87d76490810a29729126c3.

Given:

```ruby
DB = Sequel.connnect('...')

class A
set_primary_key :a_key
end

class B
set_primary_key :b_key
end
```

`A.primary_key` and `B.primary_key` return the expected values. But if I add the following:

```ruby
A.db = DB
B.db = DB
```
Then `A.primary_key` returns nil while `B.primary_key` is still correct. I haven't looked at the table level yet to see what's different between A and B, but will report back if that turns up anything useful.