#492 ✓resolved
Matt Jones

automatic lifecycle scopes fail in weird ways on STI models

Reported by Matt Jones | August 21st, 2009 @ 10:29 PM | in Hobo 1.0 - Final

Two models: User and SpecialUser < User.

Both have a lifecycle state :inactive.

This works: SpecialUser.inactive

This fails: User.inactive; SpecialUser.inactive

Very short error (called from irb):

NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.call

from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/named_scope.rb:102:in `inactive'
from (irb):3</code>



The issue appears to be that the scopes array is not correctly populated.

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

Referenced by

Pages