On Nov 29, 2007 11:49 AM, Judson L. [email protected] wrote:
Looking back at that comment, I believe what I meant was that, rather than
use OGTABLE, and assign it based on the klass, instead, just use
klass.table(), and be sure that klass.table for SchemaInheritence works. In
general, it was my thinking at the time that klass.table should be the
correct way to determine the table name, although in a perfect world, client
Thanks for the insight, that is useful.
code wouldn’t ever need to, except in unusual circumstances - like migrating
out of Og, or trying to understand the library better.
Looking at the code now, later, I can’t find Og::SchemaInheritenceBase at
all. Has STI been abandoned?
would be good to have an issue tracker…
Anyway, for the record, the following spec requires a flexmock and why
might be worth thinking about?
I’m cheating a little by not doing a full blown Og.start -
DummyDatabase is a sub-class of DbiAdapter, with some methods
overridden to allow me to see the sql statements generated.
describe DbiAdapter, “#table_exists?” do
before(:each) do
@db = DummyDatabase.new
flexmock(@db).should_receive(:tables).and_return([:a,
:b]).times(3).ordered
end
it "should use Database#tables if available" do
@db.table_exists?(:a).should be_true
@db.table_exists?(:b).should be_true
@db.table_exists?(:c).should be_false
end
end
Mark