On 28.05.2010, at 9:18, Pat Allan wrote:

Hi Alexander

named_scopes are for SQL queries, and so you really shouldn't be using them in combination with search queries. There are sphinx_scopes for this purpose instead:
http://freelancing-god.github.com/ts/en/scopes.html

The problem is with ordinary named scopes:

post.rb:
  CATEGORIES = [:ordinary, :silver, :golden, :brilliant]

CATEGORIES.each {|c| named_scope(c, {:conditions => {:category => category_number(c)}})}
  named_scope :with_categories, :include => [:categories]

posts_controller:
  def golden
@sticky_posts = @clan .posts.published.with_categories.golden.by_bumped_at.sticky.not_trashed

The code above fails.
Well, probably I should write script reproducing error...



If I'm misunderstanding the issue, what are you trying to do that's causing these errors?

Cheers

--
Pat

On 28/05/2010, at 3:11 PM, Alexander Sviridov wrote:

Hello!
After upgrading TS to 1.3.16 I've run into a bug in named_scopes:
NoMethodError: undefined method `call' for nil:NilClass (traceback: 
http://gist.github.com/416785)

I tried a fix from here 
http://github.com/tablatom/hobo/commit/04cfc5b79ff528791e5a4aa352ded6b9d7e2c94f
It worked for named_scopes, but caused this: TypeError: can't modify frozen hash (traceback: http://gist.github.com/416787)

Also, our production server runs ruby 1.8.6, could this be a cause?

Would be glad for any ideas...

Thank you


--
You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to thinking- [email protected]. To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en .


--
You received this message because you are subscribed to the Google Groups "Thinking Sphinx" 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/thinking-sphinx?hl=en .


--
You received this message because you are subscribed to the Google Groups "Thinking 
Sphinx" 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/thinking-sphinx?hl=en.

Reply via email to