#762 ✓resolved
Betelgeuse

hobo_model outside a full rails env can lead to stack level too deep

Reported by Betelgeuse | July 15th, 2010 @ 09:51 PM

While trying to write some rubydoctests for Hobo I stumbled upon loading hobo causing a stack level too deep so most likely an endless loop. I also remember seeing stack level too deep issues on mailing lists so maybe fixing this will help them too. If this code is faulty in that hobo_model can't be made to work with it then for developer sanity it should give a meaningful error message:

require 'active_record'
ActiveRecord::ActiveRecordError
require 'action_view'
require 'action_controller'
RAILS_ROOT='.'
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
require 'will_paginate/finder'
$:.unshift 'hobo/lib'
require 'hobo'
require 'hobo/model'
class Unexisting < ActiveRecord::Base
  hobo_model
  fields do
  end
end

This can be run inside a clone of a git repo.

betelgeuse@pena ~/hobo/hobo-pristine $ ruby noclass.rb 
./hobo/lib/hobo/model.rb:343:in `method_missing': stack level too deep (SystemStackError)
        from ./hobo/lib/hobo/model.rb:345:in `method_missing'
        from ./hobo/lib/hobo/model.rb:46:in `included'
        from ./hobo/lib/hobo/model.rb:124:in `include'
        from ./hobo/lib/hobo/model.rb:124:in `hobo_model'
        from noclass.rb:12

Comments and changes to this ticket

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.

New-ticket Create new ticket

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

Pages