Phil Pirozhkov
Phil Pirozhkov
It surely makes sense to add a note to the safety section. It would be perfect if the note referred to a Rails ticket, especially if the Rails team acknowledges...
I agree with your point, with a small note. > the user is present, so valid? is true It makes sense according to [the Rails guides](https://guides.rubyonrails.org/association_basics.html#options-for-belongs-to-validate): > If you set...
Would you like to share the effort, @stephannv ?
> validate: true should be set, but I don't believe it is relevant here Indeed. This is why we're thinking of: > this can became two cops > adding a...
What's strange, it this test `Post.belongs_to_required_by_default` is `nil`. While in the real code it is supposed to be `true`. Add ```ruby ActiveRecord::Base.belongs_to_required_by_default = true ``` to your snippet. You also...
As a side note, I'd say that it might make sense to ask the Rails team a question regarding [executable test cases](https://guides.rubyonrails.org/contributing_to_ruby_on_rails.html#create-an-executable-test-case) specifically for `ActiveRecord`. Without loading the defaults those...
That would be perfect. There's a guideline for this, too https://rails.rubystyle.guide/#config-defaults
@vizcay Would you like to contribute such a cop provided necessary guidance?
@vizcay I'd suggest adding a cop (there is a rake generator task); set `Include` in `config/default.tml` to `config/application.rb`. To scan through the whole file just once you can use `def...
There was a problem recently on my current project. We were making checks for `Rails.env.production?` in data migrations. However, we use a different environment to run migrations, and it points...