initial hobo_migration fails
Reported by Bryan Larsen | December 23rd, 2009 @ 12:09 AM | in Hobo 1.0 - Final
The thingybob smoke test fails with edge hobo. ./script/generate hobo_migration doesn't run because Hobo.rails_initializer is not set.
Comments and changes to this ticket
-
Bryan Larsen December 23rd, 2009 @ 12:10 AM
- State changed from new to resolved
(from [73f3107a0d16001d91a61f2419ec9802353f3cf2]) [#591 state:resolved] don't depend on Hobo.rails_initializer http://github.com/tablatom/hobo/commit/73f3107a0d16001d91a61f2419ec...
-
Matt Jones December 23rd, 2009 @ 12:20 AM
- Milestone set to Hobo 1.0 - Final
- Tag set to defect, rich-types
- State changed from resolved to open
- Assigned user set to Matt Jones
That commit will certainly silence the issue, but it's not actually dealing with the problem. The hazard is that a model with a type declared in a plugin will fail (or behave strangely) when generating the migration as the type lib won't be loaded when the migration generator runs.
I'll take a look at the test, but I'm guessing that the issue is related to https://rails.lighthouseapp.com/projects/8994/tickets/1757 - does the thingybob test run Hobo from a gem or from vendor/plugins?
-
Bryan Larsen December 28th, 2009 @ 09:05 PM
Yes, I'm not sure what I was smoking when I thought that was a sufficient fix. Here's thingybob: http://github.com/bryanlarsen/hobo-test-environment/blob/master/smo... . It essentially tests Hobo-as-a-gem and is a script of the two minute tutorial. Hopefully it eventually will grow beyond that...
It appears that we'll have to bring back the FakeInitializer I used before and was so happy to get rid of. Rails::Initializer#load_gems doesn't pass down the initializer like the plugin loader does, and we can't monkey patch the function that loads us. Any other ideas?
-
Matt Jones December 28th, 2009 @ 09:31 PM
Even as a gem, the file in rails/init.rb is supposed to be loaded by the plugin loader; maybe we could stash the initializer there? I also haven't checked to see if this bug is still present.
There is an issue with loading plugins that are specified in a specific environment file, but I can't think of any situation where loading Hobo in, say, environments/development.rb would make even a tiny bit of sense, so there's no need to worry there...
-
Bryan Larsen December 28th, 2009 @ 09:47 PM
I'm having trouble parsing your first comment. If you meant to say hobo/init.rb, according to my testing, hobo-0.9.103/init.rb is never loaded when hobo is being used as a gem.
-
Matt Jones December 28th, 2009 @ 09:56 PM
It's poorly documented, but the plugin loader will load the file in GEM_DIR/rails/init.rb if present. This should (as of this commit ) work correctly for both vendor/plugins plugins and gem plugins. Looks like it was in 2.2.2 as well.
-
Bryan Larsen December 28th, 2009 @ 11:10 PM
Awesome, that file actually loads. Now the problem is that the line in question actually runs during load_gems rather than during load_plugins (load_gems happens first).
It seems to me that the Hobo.enable at the bottom of hobo.rb should be moved into init.rb. Does that seem reasonable to you?
-
Tom Locke December 29th, 2009 @ 10:18 AM
It seems to me that the Hobo.enable at the bottom of hobo.rb should be moved into init.rb. Does that seem reasonable to you?
Back when that was first coded, init.rb was not run for gems, only for plugins. If that has changed I don't see why it cant be moved.
-
Bryan Larsen December 29th, 2009 @ 06:30 PM
- State changed from open to resolved
(from [66973614b099b800b4288e08bc37d48cb2366dd8]) [#591 state:resolved] move init.rb to rails/init.rb and Hobo.enable to init.rb http://github.com/tablatom/hobo/commit/66973614b099b800b4288e08bc37...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
People watching this ticket
Tags
Referenced by
- 591 initial hobo_migration fails (from [73f3107a0d16001d91a61f2419ec9802353f3cf2]) [#591 s...
- 591 initial hobo_migration fails (from [66973614b099b800b4288e08bc37d48cb2366dd8]) [#591 s...