Petrik de Heus

Results 175 comments of Petrik de Heus

@loqimean You can add a test here: https://github.com/rails/rails/blob/6ca6aba66c23414db2fc17bab62e3cecda025f6d/activerecord/test/cases/finder_test.rb Regular `exists?` is defined here: https://github.com/rails/rails/blob/6ca6aba66c23414db2fc17bab62e3cecda025f6d/activerecord/lib/active_record/relation/finder_methods.rb#L357

Another use case for an empty form, is a form with the submit button outside the form element: ```html :+1 ``` This would be useful when the button is already...

@fxn I think the following works for me (but I don't have much experience in using `to_prepare`): ```ruby ActiveSupport::Reloader.to_prepare do ActiveSupport.on_load(:active_record) do # Setup an AR model on boot and...

@fxn We could allow the silencing to accept a block: ```ruby ActiveSupport::Reloader.to_prepare do ActiveSupport.silence_prematurely_loading_warnings do # Setup an AR model on boot and reload here. end end ```

What I'm reading from @casperisfine's comment is that permaturely loading ActiveRecord shouldn't cause a problem. I agree, but solving that seems like a big undertaking. There is a [whole section](https://guides.rubyonrails.org/engines.html#load-and-configuration-hooks)...

There was an similar PR to solve this: #38024 [This comment ](https://github.com/rails/rails/issues/39855#issuecomment-659670294) mentions previous reports of the same problem: - https://github.com/rails/rails/issues/23589 - https://github.com/rails/rails/issues/27844 - https://github.com/rails/rails/issues/33283 - https://github.com/rails/rails/issues/36322 - https://github.com/rails/rails/issues/37030

Thanks @fxn for the extensive feedback. I hope to dive into this again later this week.

Thanks @braindeaf ! I'll merge it after the typo fix.

@braindeaf Sorry, could you squash your commits to a single commit as well? 🙇