Single Table Inheritance problem

19 views
Skip to first unread message

VegHead

unread,
Jan 22, 2010, 11:03:48 AM1/22/10
to Hobo Users
I'm getting an error when running db:migrate for my Hobo project with
a clean database. I have two models, A and B, where B extends A
through single-table-inheritance. Creating everything works. But if I
start with a fresh database, rake fails with an error:

$ rake db:migrate
(in /Users/myuser/src/test)
rake aborted!
Table as does not exist

Here are the steps I went through to reproduce this. First, create the
Hobo app:

$ hobo testproject

Create the first model, A:

$ ruby script/generate hobo_model_resource a name:string type:string

Setup database.yml, generate and execute the migration:

$ ruby script/generate hobo_migration

Create the second model, B:

$ruby script/generate hobo_model_resource b

Edit the B model to extend A:

class B < A

# --- Permissions --- #
def create_permitted?
acting_user.administrator?
end

def update_permitted?
acting_user.administrator?
end

def destroy_permitted?
acting_user.administrator?
end

def view_permitted?(field)
true
end
end

Generate and run the migration:

$ ruby script/generate hobo_migration

Voila. All works fine. Now, if I delete all the tables and run
db:migrate, it fails:

$ rake db:migrate
(in /Users/myuser/src/test)
rake aborted!
Table as does not exist

Following the suggestions at
http://stackoverflow.com/questions/646391/ruby-on-rails-single-table-inheritance-sti-and-unit-test-problem-with-postgres,
I tried removing test/fixtures/as.yml and test/fixtures/bs.yml, but
that didn't help.

hobo 0.9.103
rails 2.3.5
rake 0.8.7
jruby 1.4.0RC1

Any suggestions?

kevinpfromnm

unread,
Jan 22, 2010, 1:31:33 PM1/22/10
to Hobo Users
did you delete the schema_info table as well?

> Following the suggestions athttp://stackoverflow.com/questions/646391/ruby-on-rails-single-table-...,

VegHead

unread,
Jan 22, 2010, 2:30:06 PM1/22/10
to Hobo Users
Yup. Basically started with a brand new database... no tables at all.

VegHead

unread,
Jan 22, 2010, 2:31:59 PM1/22/10
to Hobo Users
Also, note that I cannot reproduce this with a straight Rails setup.

kevinpfromnm

unread,
Jan 22, 2010, 2:36:29 PM1/22/10
to Hobo Users
Oh wait, there is a bug open for that I think. I haven't done
anything with STI myself but I've seen mention of it pop up a few
times. Something about being unable to create the child table unless
the parent table is already in place IIRC.

Matt Jones

unread,
Jan 22, 2010, 2:40:47 PM1/22/10
to hobo...@googlegroups.com

On Jan 22, 2010, at 2:30 PM, VegHead wrote:

> Yup. Basically started with a brand new database... no tables at all.

Even in vanilla Rails, migrating on a blank DB isn't the preferred way
to clear the db - rake db:reset should work better, and has the
advantage of re-seeding the DB, if your using the db/seeds.rb stuff
added in Rails 2.3.

There's a ticket about this someplace on the LH - as I recall, there's
a place where we call 'columns' on a model without a table during the
setup process.

--Matt Jones

VegHead

unread,
Jan 22, 2010, 3:21:05 PM1/22/10
to Hobo Users
Shoot. Accidentally replied directly to Matt Jones. *sigh*

On Jan 22, 1:40 pm, Matt Jones <al2o...@gmail.com> wrote:
> On Jan 22, 2010, at 2:30 PM, VegHead wrote:
>
> > Yup. Basically started with a brand new database... no tables at all.
>
> Even in vanilla Rails, migrating on a blank DB isn't the preferred way  
> to clear the db - rake db:reset should work better, and has the  
> advantage of re-seeding the DB, if your using the db/seeds.rb stuff  
> added in Rails 2.3.

There is a scenario where it is normal for the user/developer to have
a blank db: adding a new member to the development team.

In fact, that's how I discovered this. Another developer checked out
the project, added the necessary database users, created the databases
and tried to run the migrations. He immediately ran into the "Table
foo does not exist" error.

That's also why I was testing with a blank database - I was trying to
recreate his experience.

-Sean

VegHead

unread,
Jan 22, 2010, 3:21:58 PM1/22/10
to Hobo Users
Any pointers to the bug? Link? I might be interested in trying to
tackle it... it's a rather annoying problem for me in my current
project.

-Sean

VegHead

unread,
Jan 22, 2010, 3:39:09 PM1/22/10
to Hobo Users
As Matt pointed out offline, we shouldn't be running the migrations
for a new developer.

"Even in this case, you'll want to run something like db:setup (which
creates the db, loads the schema from db/schema.rb and seeds it)
rather than mucking around with re-running all the migrations."

Unfortunately, db:setup produces the same results:

$ rake db:setup
...


rake aborted!
Table as does not exist

-Sean

Matt Jones

unread,
Jan 22, 2010, 4:25:06 PM1/22/10
to hobo...@googlegroups.com
Ah, got it now. I could have *sworn* db:schema:load worked even in
this instance, but peeking at the source in Rails 2.3.5 shows that's
not the case; that task requires the environment to load first as well.

I've got some free cycles this weekend; I'll take a look at it. I
*thought* this was a repeat of #345 (https://hobo.lighthouseapp.com/projects/8324/tickets/345-inheritance-is-broken-again
), but it's a little different.

--Matt Jones

> --
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to hobousers+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/hobousers?hl=en
> .
>

kevinpfromnm

unread,
Jan 22, 2010, 4:27:05 PM1/22/10
to Hobo Users
I've got a fairly complex app on edge hobo that I just tried deleting
the db (sqlite) and reloading from schema and it worked with no errors
for me.

On Jan 22, 2:25 pm, Matt Jones <al2o...@gmail.com> wrote:
> Ah, got it now. I could have *sworn* db:schema:load worked even in  
> this instance, but peeking at the source in Rails 2.3.5 shows that's  
> not the case; that task requires the environment to load first as well.
>
> I've got some free cycles this weekend; I'll take a look at it. I  

> *thought* this was a repeat of #345 (https://hobo.lighthouseapp.com/projects/8324/tickets/345-inheritance-...

VegHead

unread,
Jan 22, 2010, 4:41:10 PM1/22/10
to Hobo Users
Yeah, #345 is really really close... Is it possible I don't have the
fix that Tom Locke made for #345? I'm running hobo 0.9.103 and it
looks like he made that change for 1.0RC1.

-Sean

On Jan 22, 3:25 pm, Matt Jones <al2o...@gmail.com> wrote:
> Ah, got it now. I could have *sworn* db:schema:load worked even in  
> this instance, but peeking at the source in Rails 2.3.5 shows that's  
> not the case; that task requires the environment to load first as well.
>
> I've got some free cycles this weekend; I'll take a look at it. I  

> *thought* this was a repeat of #345 (https://hobo.lighthouseapp.com/projects/8324/tickets/345-inheritance-...

Matt Jones

unread,
Jan 22, 2010, 4:52:58 PM1/22/10
to hobo...@googlegroups.com

On Jan 22, 2010, at 4:41 PM, VegHead wrote:

> Yeah, #345 is really really close... Is it possible I don't have the
> fix that Tom Locke made for #345? I'm running hobo 0.9.103 and it
> looks like he made that change for 1.0RC1.
>
> -Sean

0.9.100 was (I think) right around RC1; the naming is a little
confusing. The issue closed by #345 wouldn't handle your case, as the
migration generator does an entirely different class-loading dance
than the standard methods. Just to speed things up for me, can you
post a complete backtrace (run 'rake db:migrate --trace') of the error?

--Matt Jones

VegHead

unread,
Jan 22, 2010, 4:59:33 PM1/22/10
to Hobo Users

$ rake db:setup --trace
(in /Users/myuser/src/testproject)
** Invoke db:setup (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
testproject_dev already exists
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment


rake aborted!
Table as does not exist

/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/base.rb:1271:in `columns'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobofields-0.9.103/lib/hobo_fields/model_extensions.rb:212:in `column'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/scopes/automatic_scopes.rb:340:in `column'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/scopes/automatic_scopes.rb:171:in `create_scope'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/scopes/automatic_scopes.rb:8:in
`create_automatic_scope'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model.rb:354:in `respond_to?'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/core_ext/class/
inheritable_attributes.rb:125:in
`inherited_with_inheritable_attributes'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/observer.rb:50:in `inherited'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/base.rb:401:in `inherited'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobofields-0.9.103/lib/hobo_fields/model_extensions.rb:30:in
`inherited'
/Users/myuser/src/testproject/app/models/b.rb:1
/Users/myuser/src/testproject/app/models/b.rb:380:in `load'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
`load_file'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:379:in
`load_file'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:259:in
`require_or_load'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:425:in
`load_missing_constant'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
`const_missing_with_dependencies'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
`const_missing'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/inflector.rb:361:in
`constantize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/inflector.rb:360:in `each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/inflector.rb:360:in
`constantize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:
162:in `constantize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_controller.rb:86:in `model'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_controller.rb:299:in
`available_auto_write_actions'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_controller.rb:286:in
`available_auto_actions'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_controller.rb:128:in `auto_actions'
/Users/myuser/src/testproject/app/controllers/bs_controller.rb:5
/Users/myuser/src/testproject/app/controllers/bs_controller.rb:380:in
`load'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
`load_file'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:379:in
`load_file'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:259:in
`require_or_load'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:425:in
`load_missing_constant'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
`const_missing_with_dependencies'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
`const_missing'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/inflector.rb:361:in
`constantize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/inflector.rb:360:in `each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/inflector.rb:360:in
`constantize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:
162:in `constantize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_controller.rb:61:in `all_controllers'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_controller.rb:57:in `each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_controller.rb:57:in `all_controllers'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_router.rb:97:in `add_routes_for'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_router.rb:83:in `add_routes'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_router.rb:83:in `each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo/model_router.rb:83:in `add_routes'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
hobo-0.9.103/lib/hobo.rb:73:in `add_routes'
/Users/myuser/src/testproject/config/routes.rb:6
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/routing/route_set.rb:226:in
`draw'
/Users/myuser/src/testproject/config/routes.rb:1
/Users/myuser/src/testproject/config/routes.rb:145:in `load'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:145:in
`load_with_new_constant_marking'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:145:in
`load_with_new_constant_marking'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in
`load_routes!'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in
`each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in
`load_routes!'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/routing/route_set.rb:266:in
`load!'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rails-2.3.5/lib/initializer.rb:537:in `initialize_routing'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rails-2.3.5/lib/initializer.rb:188:in `process'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rails-2.3.5/lib/initializer.rb:113:in `run'
/Users/myuser/src/testproject/config/environment.rb:9
/Users/myuser/src/testproject/config/environment.rb:31:in `require'
/Users/myuser/Apps/jruby/current/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:31:in `require'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rails-2.3.5/lib/tasks/misc.rake:4
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:636:in `call'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:636:in `execute'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:631:in `each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:631:in `execute'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/Users/myuser/Apps/jruby/current/lib/ruby/1.8/monitor.rb:242:in
`mon_synchronize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:604:in `each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/Users/myuser/Apps/jruby/current/lib/ruby/1.8/monitor.rb:242:in
`mon_synchronize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:604:in `each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/Users/myuser/Apps/jruby/current/lib/ruby/1.8/monitor.rb:242:in
`mon_synchronize'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:583:in `invoke'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:2029:in `each'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:2001:in `run'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake.rb:1998:in `run'
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/bin/rake:31
/Users/myuser/Apps/jruby/jruby-1.4.0RC1/lib/ruby/gems/1.8/gems/
rake-0.8.7/bin/rake:19:in `load'
/Users/myuser/Apps/jruby/current/bin/rake:19

Matt Jones

unread,
Jan 22, 2010, 5:16:32 PM1/22/10
to hobo...@googlegroups.com

Nothing like a little live patching... can you try adding this line:

return unless table_exists?

at the very beginning of the column method (line 211 of hobofields/lib/
hobo_fields/model_extensions.rb)?

The trace has the automatic scope code trying to see if
inherited_without_inheritable_attributes is a column, which hits the
DB and dies. This code essentially says, "if the DB isn't there,
nevermind about that scope...".

--Matt JOnes

VegHead

unread,
Jan 22, 2010, 5:41:02 PM1/22/10
to Hobo Users
On Jan 22, 4:16 pm, Matt Jones <al2o...@gmail.com> wrote:
> Nothing like a little live patching... can you try adding this line:
>
> return unless table_exists?
>
> at the very beginning of the column method (line 211 of hobofields/lib/
> hobo_fields/model_extensions.rb)?
>
> The trace has the automatic scope code trying to see if  
> inherited_without_inheritable_attributes is a column, which hits the  
> DB and dies. This code essentially says, "if the DB isn't there,  
> nevermind about that scope...".

Woo woo!

That did the trick. Worked perfectly.

Thanks! That is very cool. This is why I love open source. :)

Sean

Owen

unread,
Jan 23, 2010, 7:41:59 AM1/23/10
to Hobo Users
Nice, Matt.

Matt Jones

unread,
Jan 24, 2010, 8:18:06 PM1/24/10
to hobo...@googlegroups.com

Reminds me of the old stories about IBM tech support back in the Iron
Age: staff engineers would apparently give field support lists of
*physical* patches (ie, solder a wire from A to B on card X) to the
mainframe circuits, over the phone...

:)

--Matt Jones

Owen Dall

unread,
Jan 25, 2010, 8:02:08 AM1/25/10
to hobo...@googlegroups.com
That's good.  :-)

--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.
To post to this group, send email to hobo...@googlegroups.com.
To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.




--
Thanks,

Owen

Owen Dall
Barquin International
410-991-0811
Reply all
Reply to author
Forward
0 new messages