Phil Pirozhkov

Results 566 comments of Phil Pirozhkov

Should we recommend `return render …`?

Hey Victor! Interesting case with delete_all indeed. But how is the styleguide/cop responsible for such an inconsistent and surprising behavior in Rails? Without any cop or a guideline, wouldn’t you...

The example ‘person.pets.delete(Pet.find(1))’ looks quite weird. I would probably write it differently, but this notation deserves to exist. In contrast to the surprising nullify for delete_all on has_many, this is...

> can safely be removed from every statement is very dangerous It’s a very good point. I doubt that the guide is providing guarantees that switching from a “bad” style...

A practical clarification. Why wasn’t the change from ‘user.articles.all.delete_all’ to ‘user.articles.delete_all’ detected? I recon it should have been caught by a not null database constraint on ‘articles.user_id’ column?

The guideline can make a note regarding the ‘delete’/‘delete_all’ and the default ‘dependent’. It would still tell to not use the ‘.all’, in all cases. But it, ot another guideline/cop...

I didn’t look close yet, but seems interested at a glance https://about.gitlab.com/blog/2021/09/29/why-we-spent-the-last-month-eliminating-postgresql-subtransactions/

Let’s leave it out to the Rails team to print deprecation warnings.

Have you had a chance to check #275 #337 #43?