Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional value not supported for last argument? #23

Closed
gamov opened this issue Aug 12, 2014 · 3 comments · Fixed by #27
Closed

Optional value not supported for last argument? #23

gamov opened this issue Aug 12, 2014 · 3 comments · Fixed by #27

Comments

@gamov
Copy link

gamov commented Aug 12, 2014

I have a method defined this way:

def latest_duty_tax(cat, country_code=@country)

end
memoize :latest_duty_tax

It works with ActiveSupport::Memoizable but triggers an exception with Memoist:

sidr.latest_duty_tax(cat, country_code, :reload)
# =>
#ArgumentError:   wrong number of arguments (3 for 2)
#/app/services/shipping_item_data_retriever.rb:24:in `latest_duty_tax'
#/.rvm/gems/ruby-1.9.3-p545@ector/gems/memoist-0.9.3/lib/memoist.rb:174:in `latest_duty_tax'
@matthewrudy
Copy link
Owner

good one.
need to look at this.

@findchris
Copy link

Good catch 👍

@ajmurmann
Copy link

just encountered the same issue with an optional Hash as the last argument. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants