namespace for hobo_model_resource problems
Reported by Hamilton | June 17th, 2009 @ 01:27 AM
Using hobo 0.8.7
Did:-
hobo_model_resource test_subsite::tea bal:text bal2:string
Got the following output:-
create app/models/test_subsite exists app/controllers/test_subsite
exists app/helpers/test_subsite create app/views/test_subsite/teas
exists test/functional/test_subsite create test/unit/test_subsite
dependency hobo_model exists app/models/test_subsite exists
test/unit/test_subsite create test/fixtures/test_subsite exists
app/viewhints create app/models/test_subsite/tea.rb create
app/viewhints/test_subsite/tea_hints.rb No such file or directory -
/Users/dev/workspaces/hobo_test/app/viewhints/test_subsite/tea_hints.rb
Process finished with exit code 0
I created the directory and reran hobo_model_resource
test_subsite::tea bal:text bal2:string
Output looked good.
However hobo migration gives the following error:-
/usr/bin/ruby -e
STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift)
/Users/dev/workspaces/hobo_test/script/generate hobo_migration -s
/Users/dev/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in
load_missing_constant': uninitialized constant Tea
(NameError) from
/Users/dev/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in
const_missing'
from
/Users/dev/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in
const_missing' from
/Users/dev/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/inflector.rb:361:in
constantize'
from
/Users/dev/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/inflector.rb:360:in
each' from
/Users/dev/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/inflector.rb:360:in
constantize'
from
/Users/dev/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/string/inflections.rb:162:in
constantize' from
/Library/Ruby/Gems/1.8/gems/hobo-0.8.7/lib/hobo/model_controller.rb:86:in
model'
from
/Library/Ruby/Gems/1.8/gems/hobo-0.8.7/lib/hobo/model_controller.rb:299:in
available_auto_write_actions' ... 42 levels... from
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
require'
from /Users/dev/workspaces/hobo_test/script/generate:3 from -e:1:in
`load' from -e:1
Process finished with exit code 1
This is really killing me, I do not know how to fix it yet. Is there something I need to add to routes.rb?
Comments and changes to this ticket
-
Bryan Larsen June 17th, 2009 @ 05:28 PM
Putting models into a subsite is very strange. Is that what you want to do? The usual pattern is to use subsites for controllers & views.
Here's a pattern to follow and modify. ( we really need documentation for subsites! )
hobo s2 cd s2 script/generate hobo_model tea bal:text bal2:string script/generate hobo_subsite --no-front-site subsite script/generate hobo_migration
Create app/controllers/subsite/teas_controller.rb:
class Subsite::TeasController < Subsite::SubsiteSiteController hobo_model_controller Tea auto_actions :all end
-
Bryan Larsen October 22nd, 2009 @ 08:38 PM
- State changed from new to invalid
- Tag set to enhancement, generator
Now I understand why the subspaced models almost worked. It was purely an accident of good design -- it wasn't intentional. I'm marking it as invalid since you seem to have things working. If you really want the bug fixed, reopen it and I'll mark it post-1.0.
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 »