rsim/ruby-plsql — Issue #24: Setting plsql.activerecord_class throws 'Wrong ActiveRecord class' exception
Author: jasonkarns
Created: 2012-01-26 19:01:14+00:00
State: open

Attempting to set plsql.activerecord_class to a class that inherits from ActiveRecord::Base fails if ActiveRecord::Base is not (at most) the parent class.

For instance:

```ruby
class MyAppBase < ActiveRecord::Base
self.abstract_class = true
end

class MyModel < MyAppBase
end

plsql.activerecord_class = MyModel # throws 'Wrong ActiveRecord class'
```

Even though ActiveRecord::Base is indeed in the inheritance chain.

```irb
>> MyModel.ancestors
MyAppBase(abstract), ActiveRecord::Base, ...
```