I don't really need the Users viewhint on Locations, so this isn't
really an issue for me any more.  I am curious about how ViewHints
work when the ClassName is different than the field name.  But yeah,
so the fix for me was upgrading to edge, and just double-checking all
my models.  Hobo doesn't like it when you're missing your
"has_many :join_table".

Thanks for taking a look guys!

On Dec 8, 3:28 pm, Brian Corbin <[email protected]> wrote:
> I removed the associations again to reproduce the error.  I applied
> the patch but still got the same error, as refl.klass.nil? won't work
> if refl doesn't respond to klass.  Changed it to return nil if !
> refl.respond_to?("klass"), and got the error in a different place,
> line 328..
>
> On Dec 8, 3:17 pm, Brian Corbin <[email protected]> wrote:
>
> > I take it back, that was the issue.  After I added in the missing
> > has_many associations, hobo:generate_taglibs completed succesfully.
> > Sorry, somehow I knew this would turn out to be all my fault.  Anyway,
> > I know have another issue.  My user model
> > belongs_to :default_location, class_name => "Location".  The
> > children :users declaration doesn't pick up on that and results in
> > this:
> > SQLite3::SQLException: no such column: users.location_id: SELECT count
> > (*) AS count_all FROM "users" WHERE ("users".location_id = 1)
>
> > Is there a way to tell the children directive what the database field
> > is?  Thanks-
>
> > Brian
>
> > On Dec 8, 3:01 pm, Brian Corbin <[email protected]> wrote:
>
> > > My Location model was missing has_many :location_products, and my
> > > Product model was missing has_many :location_products.  Adding these
> > > did not affect this error however.
>
> > > Brian
>
> > > On Dec 8, 2:43 pm, Brian Corbin <[email protected]> wrote:
>
> > > > That's in the edit-page tag for LocationProduct
>
> > > > 112 <def tag="edit-page" for="LocationProduct">
> > > > 113   <page merge title="#{ht
> > > > 'location_products.edit.title', :default=>['Edit Location
> > > > Product'] }">
> > > > 114
> > > > 115     <body: class="edit-page location product" param/>
> > > > 116
> > > > 117     <content:>
> > > > 118       <section param="content-header">
> > > > 119         <h2 param="heading">
> > > > 120           <ht key="location_products.edit.heading"
> > > > name="&this.respond_to?(:name) ? this.name : ''">
> > > > 121             Edit <type-name/>
> > > > 122           </ht>
> > > > 123         </h2>
> > > > 124         <delete-button label="#{ht
> > > > 'location_products.actions.delete', :default=>['Remove This Location
> > > > Product']}" param/>
> > > > 125       </section>
> > > > 126
> > > > 127       <section param="content-body">
> > > > 128         <form param/>
> > > > 129       </section>
> > > > 130     </content:>
> > > > 131
> > > > 132   </page>
> > > > 133 </def>
> > > > 134
>
> > > > On Dec 8, 2:26 pm, Bryan Larsen <[email protected]> wrote:
>
> > > > > You've run into a rails 2.3.5 
> > > > > bug:https://hobo.lighthouseapp.com/projects/8324-hobo/tickets/574-rails-2...
>
> > > > > Could you snip line 124 (and some surrounding context) from your
> > > > > app/views/taglibs/auto/rapid/pages.dryml and post it, please?
>
> > > > > thanks
> > > > > Bryan
>
> > > > > Brian Corbin wrote:
> > > > > > I've upgraded to edge.  At least I think I have :)  I followed the
> > > > > > recipe to upgrade to edge but when I did this step:  "Edit Rakefile 
> > > > > > to
> > > > > > remove the line require 'hobo/tasks/rails' if it exists."  that 
> > > > > > seemed
> > > > > > to remove all the hobo tasks from rake.
>
> > > > > > rake -T hobo
> > > > > > (in /srv/inventory)
> > > > > > rake doc:plugins:hobo                 # Generate documentation for 
> > > > > > the
> > > > > > hobo plugin
>
> > > > > > So I put that line back in the Rakefile and ran the next step: rake
> > > > > > hobo:run_standard_generators
> > > > > > That replaced user.rb, users_controller.rb, and application.dryml.
>
> > > > > > I added my fields and relationships back into the User model and
> > > > > > generated a hobo_migration just to make sure my database and models
> > > > > > still match, and they do.
>
> > > > > > Nothing else has changed, my models and view hints are as described
> > > > > > before.  I'm now getting this error:
>
> > > > > > Tue Dec 08 14:14:07 -0800 2009: Read error: #<NoMethodError: 
> > > > > > undefined
> > > > > > method `klass' for nil:NilClass>
> > > > > > /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
> > > > > > whiny_nil.rb:52:in `method_missing'
> > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> > > > > > reflection.rb:257:in `source_reflection'
> > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> > > > > > reflection.rb:257:in `collect'
> > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> > > > > > reflection.rb:257:in `source_reflection'
> > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> > > > > > reflection.rb:316:in `derive_class_name'
> > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> > > > > > reflection.rb:112:in `class_name'
> > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> > > > > > reflection.rb:156:in `klass_without_create_polymorphic_class'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/active_record/
> > > > > > association_reflection.rb:15:in `klass'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/model.rb:327:in
> > > > > > `reverse_reflection'
> > > > > > rapid/pages:124:in `run_one'
> > > > > > rapid/pages:124:in `map'
> > > > > > rapid/pages:124:in `run_one'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:141:in `each_controller'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:139:in `each'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:139:in `each_controller'
> > > > > > rapid/pages:14:in `run_one'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:88:in `run_for_subsite'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:87:in `each_pair'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:87:in `run_for_subsite'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:81:in `run'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:81:in `each'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:81:in `run'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:50:in `run'
> > > > > > /srv/inventory/vendor/plugins/hobo/hobo/lib/hobo/dryml/
> > > > > > dryml_generator.rb:33:in `reload_application'
> > > > > > /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> > > > > > reloader.rb:33:in `run'
> > > > > > /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
> > > > > > dispatcher.rb:108:in `call'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in
> > > > > > `call'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in 
> > > > > > `call'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in 
> > > > > > `each'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in 
> > > > > > `call'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:
> > > > > > 17:in `call'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:
> > > > > > 13:in `call'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in
> > > > > > `call'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:
> > > > > > 64:in `process'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
> > > > > > `process_client'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in 
> > > > > > `each'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
> > > > > > `process_client'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in 
> > > > > > `run'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
> > > > > > `initialize'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in 
> > > > > > `new'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in 
> > > > > > `run'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
> > > > > > `initialize'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in 
> > > > > > `new'
> > > > > > /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in 
> > > > > > `run'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:
> > > > > > 34:in `run'
> > > > > > /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
> > > > > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > > > > > `gem_original_require'
> > > > > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 
> > > > > > `require'
> > > > > > script/server:3
>
> > > > > > rake hobo:generate_taglibs gives the same error.  So upgrading to 
> > > > > > edge
> > > > > > got rid of the first error, and now I only get that second one :)
> > > > > > Thanks,
>
> > > > > > Brian
>
> > > > > > On Dec 8, 11:44 am, Bryan Larsen <[email protected]> wrote:
> > > > > >> The first error is almost 
> > > > > >> certainlyhttps://hobo.lighthouseapp.com/projects/8324-hobo/tickets/565-rake-ho...,
> > > > > >> which should be fixed in edge.  This is the error you provided more
> > > > > >> detail for.    I presume you're running 0.9.102.
>
> > > > > >> Could you give us a backtrace for the second error?
>
> > > > > >> And yes, this is the first place to come for help for problems 
> > > > > >> like yours.
>
> > > > > >> cheers,
> > > > > >> Brayn
>
> > > > > >> Brian Corbin wrote:
> > > > > >>> I'm getting an error when I try and use ViewHints and I'm not sure
> > > > > >>> what I'm doing wrong.  A simple has_many/belongs_to relationship 
> > > > > >>> works
> > > > > >>> fine in a test application, but in the app I'm working on now, 
> > > > > >>> pretty
> > > > > >>> much any children declaration in the ViewHints causes the app to 
> > > > > >>> crash
> > > > > >>> without rendering anything to the screen.  I seem to get one of 
> > > > > >>> two
>
> ...
>
> read more »

--

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


Reply via email to