3 ms·
1.method(:day).source_location <= your friend was wrong shrug Look, I'm not a big fan of all of Rails' monkeypatching. That's why I don't use Rails anymore, I
by jaredcwhite 11mo ago
1.method(:day).source_location <= your friend was wrong shrug
Look, I'm not a big fan of all of Rails' monkeypatching. That's why I don't use Rails anymore, I use other Ruby frameworks like Bridgetown, Roda, and Hanami. But there's definitely a way to dive into the "magic" and find out what's going on.
- montroser 11mo agoAh, that's good to know! Yeah, he was wrong about a lot of stuff, so that adds up. He ended up in jail for a stint.
- jaredcwhite 11mo agowhoa
- bradgessler 11mo agoQuite the plot twist there
- radanskoric 11mo agoWoah, this thread escalated quickly.
- hoipaloi 11mo agoyou monkeypatch over core methods like that they put you in jail right away no trial, no nothing. Metaprogrammers... we have a special jail for metaprogrammers. You're global variabling? Right to jail. You're using for loops instead of iterators? To jail right away. You're type checking by class... Jail. Abusing eval? Jail. You're using global variables like a drunken sailor? You right to Jail. You overuse class variables Jail. You underuse class variables believe it or not jail. You use too many tests also Jail, overuse underuse. You use define method and you could have created the methods explicitly? Believe it or not, jail right away. We have the best code monkeys in the world because of jail.
- nosman 11mo agohow does this work if i import two different gems that both monkeypatch the same classes? Even if you can see the source, it still seems difficult to understand where the monkeypatch came from if you have transitive dependencies and whatnot.
- rokob 11mo agoThe last one wins
- deleted 11mo ago[deleted]
- ryandv 11mo ago[flagged]