Skip to content

Instantly share code, notes, and snippets.

@benkoshy
Created December 22, 2022 00:50
Show Gist options
  • Save benkoshy/52a27e4ec6c40a326f5858de2cc2e259 to your computer and use it in GitHub Desktop.
Save benkoshy/52a27e4ec6c40a326f5858de2cc2e259 to your computer and use it in GitHub Desktop.
pagy issue
module QuotesHelper 

  # overrriding this
  # => wrong number of arguments (given 3, expected 2)
  def pagy_url_for(pagy, page)
    page
  end
end

We need to account for the additional arguments:

class pagy
  def pagy_url_for(pagy, page, absolute: false, html_escaped: false)
    etc.
  end

So I just passed them in manually:

module QuotesHelper 
  # overrriding this  
  def pagy_url_for(pagy, page, absolute: false, html_escaped: false)
    page
  end
end

Is there a way of making those extra arguments optional, and then providing a deprecation warning?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment