Reviewing monkey patches when updating gems
28-Feb-2025 19
When I installed Writebook for booklet.goodenoughtesting.com, I monkey-patched some parts of it because I wanted to remove the creation of the first book. Later, I added some default meta tags. You can read about my approach in the article “Overriding Methods in Ruby on Rails: A No-Code-Editing Approach.” You might monkey patch a gem or a part of Rails for different reasons.
I agree that monkey patching should be the last approach and used carefully. One of the most critical issues is that the code you create depends on the structure of the code you are monkey patching, thus voluntarily violating the contract that the gem's author offered.
.
Reviewing monkey patches when updating gems #ruby #rubydeveloper #rubyonrails #Reviewing #monkey #patches #updating #gems https://rubyonrails.ba/link/reviewing-monkey-patches-when-updating-gems