I have the following named scope:
named_scope :find_all_that_match_tag, lambda { |tags| {
:select => "articles.id, tags.name",
:joins => :tags,
:conditions => ["tags.name IN (?)",tags]}
}
It works fine like this in script/console
Article.find_all_that_match_tag(["cooking"])
But if i use it like this, as part of an anonymous scope
scope = Article.scoped({})
scope = scope.scoped.find_all_that_match_tag(["cooking"])
i get a warning, on the second line:
/Users/Server/.gem/ruby/1.8/gems/activerecord-2.3.4/lib/active_record/named_scope.rb:13: warning: multiple values for a block parameter (0 for 1)
from /Users/Server/.gem/ruby/1.8/gems/activerecord-2.3.4/lib/active_record/named_scope.rb:92
It still works, but whats causing the warning? and how do i get rid of it please?