I get "stack level too deep" error when using a named scope
- by Brian Roisentul
I'm using ruby on rails 2.3.8 and when I write the syntax shown below I get the "stack level too deep" error message.
The model is called Announcement and the line of the error looks like this:
Tag.find(category_id).announcements.published
Where published is
named_scope :published, :conditions => "announcements.state = 'published'"
I use this named scope in many other places and it works fine.
What am I doing wrong? (the relationship between Tag and Announcement model is ok because if I remove the ".published" method from that line it works just fine).