huacnlee/rails-settings-cached — Issue #2: Stack Level Too Deep
Author: AnselAtoms
Created: 2012-01-19 19:56:36+00:00
State: open

When I start up my rails application I get this error message:

/usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/activerecord-3.1.0/lib/active_record/dynamic_scope_match.rb:12:in 'match': stack level too deep (SystemStackError)
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/activerecord-3.1.0/lib/active_record/base.rb:1061:in 'method_missing'
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/rails-settings-cached-0.1.2/lib/rails-settings/settings.rb:20:in 'method_missing'
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/rails-settings-cached-0.1.2/lib/rails-settings/settings.rb:108:in 'thing_scoped'
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/rails-settings-cached-0.1.2/lib/rails-settings/settings.rb:94:in 'object'
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/rails-settings-cached-0.1.2/lib/rails-settings/settings.rb:61:in '[]'
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/rails-settings-cached-0.1.2/lib/rails-settings/cached_settings.rb:14:in '[]'
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/activesupport-3.1.0/lib/active_support/cache.rb:297:in 'fetch'
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/activesupport-3.1.0/lib/active_support/cache.rb:520:in 'instrument'
... 8824 levels...
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/rack-1.3.5/lib/rack/builder.rb:51:in 'instance_eval'
from /usr/local/rvm/gems/ree-1.8.7-2011.03@voice_manager/gems/rack-1.3.5/lib/rack/builder.rb:51:in 'initialize'
from /usr/local/sipfish/webui/config.ru:1 in 'new'
from /usr/local/sipfish/webui/config.ru:1

I went into the method_missing definition in settings.rb and put a line to `puts("method is #{method}")` and the offending call is `scoped_by_thing_type_and_thing_id`. I looked through the source and could not find this class method defined anywhere, though it is called from two places (settings.rb:107 and scoped_settings.rb:9).

Version info:
Rails 3.1.0
Ruby Enterprise Edition (1.8.7)
ActiveRecord 3.1.0
rails-settings-cached 0.1.2