私は次の名前のスコープを持っています:
named_scope :find_all_that_match_tag, lambda { |tags| {
:select => "articles.id, tags.name",
:joins => :tags,
:conditions => ["tags.name IN (?)",tags]}
}
スクリプト/コンソールではこのように正常に動作します
Article.find_all_that_match_tag(["cooking"])
しかし、匿名スコープの一部として、このように使用すると
scope = Article.scoped({})
scope = scope.scoped.find_all_that_match_tag(["cooking"])
2行目に警告が表示されます。
/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
それでも機能しますが、警告の原因は何ですか?どうすればそれを取り除くことができますか?