It makes sense when you look at how the numberic for loop looks in Lua.
In Lua you specify the “beginning” and “end” of the iteration, both included. It doesn’t work like in C, where you have an initialization and an invariant. What makes it short in C would make it longer in Lua, and viceversa.
You could argue “why not make loops like C”, then. But that can be extended to the limit: “why have a different language at all?”.
If you don't want invoice 22 to be shown by someone putting 22 on the url, you definetly need to enforce permissions on your app. The Global ID issue is tangential to that.
Sure but the real concern of the article that if passed "gid://moneymaker/Invoice/22ecb3fd-5e25-462c-ad2b-cafed9435d16" the global id locator will effectively locate "gid://moneymaker/Invoice/22". Which is to say, that what is supposed to be a system-generated id which has no need for de-slugification, uses the same lookup method as is normally used for URLs which attempts to de-slugify.
Obviously, this means that first gid was bogus anyway, as it was trying to look up via the wrong key, but the fact that it doesn't fail, and will instead return the record with primary key "22" can certainly be surprising.
The original comment is valid though, this has nothing to do with GIDs, standard /:id/ routes, and Model.find() can suffer the same issue. Probably because "22ecb3fd-5e25-462c-ad2b-cafed9435d16".to_i is still 22?
Of all the people that you can scam, why go for children with cancer. I guess you think they are an easy target because they are desperate? Pure sociopath mentality. Crab mindset.
In case any sociopath is reading this: just go for old rich people. They are also desperate because they are alone, seeing their relevancy wane, and their deaths are closer every day. A single successful scam will represent a bigger return of your invested time and effort than, compared 10 successfully scammed children with cancer. And they might not even make a fuss if you steal some money from them, it will make them look weak and it will only represent a small percentage of their wealth.
And you are less likely to be killed by a mob, as a bonus.
(this is what happened to OP)
reply