Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

tagged_with Named Scope Requires Options #2

Closed
mtodd opened this Issue · 3 comments

3 participants

@mtodd

If I call tagged_with without specifying options, I get an exception thrown:

ArgumentError: wrong number of arguments (1 for 2)
from vendor/plugins/acts-as-taggable-on/lib/acts_as_taggable_on/acts_as_taggable_on.rb:90

I just installed the plugin today; this is a Rails 2.3.2 project.

Here's my proposed patch:

named_scope :tagged_with, lambda{ |tags, *options|
  options = options.shift || {}
  find_options_for_find_tagged_with(tags, options)
}
@mtodd

Rather, I think a better option could be:

named_scope :tagged_with, lambda{ |*args|
  find_options_for_find_tagged_with(*args)
end
@skizzybiz

Since this has been sitting here for 5 months without a fix, I forked it, adding the fix along with a spec:

http://github.com/skizzybiz/acts-as-taggable-on/

P.S., there are two failing specs, but they were there when I started.

@eet-nu

This issue seems to be solved. I changed the spec to confirm this.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.