Weird interaction with ActiveRecord when using :kind

1 view
Skip to first unread message

Ryan Garver

unread,
Apr 30, 2008, 6:11:52 PM4/30/08
to ruby-doodle
I discovered an interesting side effect of using the kind option for a
has macro and setting it to an ActiveRecord model class. I found that
every one of these doodle objects that I created the AR class would
make a SHOW TABLES call to the DB. Apparently the culprit is lib/
doodle.rb line 281. The AR class is having inspect called on it.

This code was getting a little too meta for me to feel comfortable
hacking away after only a week of real use. I've stopped the SHOW
TABLES by dropping the :kind option altogether.

Sean O'Halpin

unread,
Apr 30, 2008, 8:10:52 PM4/30/08
to ruby-...@googlegroups.com
On Wed, Apr 30, 2008 at 11:11 PM, Ryan Garver <raga...@gmail.com> wrote:
>
> I discovered an interesting side effect of using the kind option for a
> has macro and setting it to an ActiveRecord model class. I found that
> every one of these doodle objects that I created the AR class would
> make a SHOW TABLES call to the DB. Apparently the culprit is lib/
> doodle.rb line 281. The AR class is having inspect called on it.

Hi Ryan,

I just released a new version of the gem (0.1.2 - may take a little
while to propagate) which attempted to address this issue but which I
found on further testing merely alleviated it.

I'll dig deeper tomorrow and sort it out in the next release.

I guess I need to start doing integration testing with Rails :S

Thanks for pointing this out - much appreciated.

Regards,
Sean

Sean O'Halpin

unread,
Apr 30, 2008, 8:40:04 PM4/30/08
to ruby-...@googlegroups.com
Hi Ryan,

I've hacked a little more at it and now think I've fixed the problem.

I'd be grateful if you could check version 0.1.3 to see if it solves
the issue for you.

Regards,
Sean

Reply all
Reply to author
Forward
0 new messages