Last active
July 29, 2021 10:37
-
-
Save carellen/f9795bcbea741b0bcb0daa496f508bba to your computer and use it in GitHub Desktop.
Use postgresql regexp_replace in rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model.where("column LIKE ?", "%column content%").update_all("column = regexp_replace(column, 'regexp here', 'new content')") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment