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

Remove code for unsupported rails and ruby versions #925

Merged
merged 2 commits into from
Nov 13, 2020

Conversation

fsateler
Copy link
Contributor

Since rails < 4 and ruby < 2.2 are unsupported, we can assume that ActionController::Base.after_action and Module.prepend exist.

This fixes ViewComponent/view_component#288 , and should fix #111 (but didn't test)

Because after_action is already present in rails 4 (minimum supported version),
it is not necessary to check its existence
Prepend is available since ruby 2, which is < 2.2, and thus always available.

The previous solution, while unbreaking some cases (mileszs#574), still breaks others like
ViewComponent with rails < 6.1 (ViewComponent/view_component#288).

Because there is no longer any need to support old versions of ruby, we can dispense
with the alias method chain, and thus use a pure prepend solution, which
fixes the problem in these known cases.

We preserve the `render_with_wicked_pdf` method for backwards
compatibility.
@unixmonkey
Copy link
Collaborator

Thank you very much for this. I'm prepping for a Semver major release around dropping old Ruby & Rails versions, so it's time for this now. Sorry it took so long.

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 this pull request may close these issues.

coexistence with wicked_pdf wicked_pdf and remotipart gems can't coexist
2 participants