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
> > >>> errors, depending on the relationship I'm trying to set up.
> > >>> #<NoMethodError: undefined method `name' for nil:NilClass>
> > >>> or
> > >>>  #<NoMethodError: undefined method `klass' for nil:NilClass>
> > >>> My models have become somewhat complex, I'll see if I can describe
> > >>> what I'm trying to accomplish here before listing out the models.
> > >>> We have Users, Locations, Orders, and Products.  Join tables are
> > >>> LocationProduct and ProductOrder.
> > >>> * Users belong to a single Location called default_location.
> > >>> * Locations have Products, and for each Product, they have minimum and
> > >>> current levels.  This is to keep track of each location's product
> > >>> inventory.
> > >>> * Locations have many Orders  (There will be a sender and receiver
> > >>> location for each order, so I can decrement/increment the product
> > >>> counts and keep track of the location's inventory)
> > >>> * Orders belong to a sender and a receiver (Users)  (So I know who
> > >>> placed the order and who the customer is)
> > >>> * Orders have many Products
> > >>> * Orders belong to a sender Location and receiver Location
> > >>> * Products have many Orders (through the ProductOrders join table)
> > >>> * Products have many Locations (through the LocationProducts join
> > >>> table)
> > >>> Sorry for hurting your brain.  Well, it hurts mine at least.  Anyway,
> > >>> here are the model definitions:
> > >>> class User < ActiveRecord::Base
> > >>>   hobo_user_model # Don't put anything above this
> > >>>   fields do
> > >>>     name               :string, :required, :unique
> > >>>     email_address :email_address, :login => true
> > >>>     administrator    :boolean, :default => false
> > >>>     customer      :boolean, :default => true
> > >>>     employee     :boolean, :default => false
> > >>>     timestamps
> > >>>   end
> > >>>   belongs_to :default_location, :class_name => "Location"
> > >>> end
> > >>> class Location < ActiveRecord::Base
> > >>>   hobo_model # Don't put anything above this
> > >>>   fields do
> > >>>     name :string
> > >>>     timestamps
> > >>>   end
> > >>>   has_many :users
> > >>>   has_many :products, :through => :location_product
> > >>>   has_many :orders
> > >>> end
> > >>> class Order < ActiveRecord::Base
> > >>>   hobo_model # Don't put anything
>
> ...
>
> 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