226007daa1
Fixes: #41453 Closes: #41461 Previously when a model had strict loading set to true and then had a relation set strict_loading to false the false wasn't considered when deciding whether to raise/warn about strict loading. Code example: ```ruby class Dog < ActiveRecord::Base self.strict_loading_by_default = true has_many :treats, strict_loading: false end ``` In the example, `dog.treats` would still raise even though `strict_loading` was set to false. This is a bug effecting more than Active Storage which is why I made this PR superceeding #41461. We need to fix this for all applications since the behavior is a little surprising. I took the test from ##41461 and the code suggestion from #41453 with some additions. Co-authored-by: Radamés Roriz <radamesroriz@gmail.com> |
||
---|---|---|
.. | ||
attached | ||
attachment_test.rb | ||
blob_test.rb | ||
filename_test.rb | ||
presence_validation_test.rb | ||
preview_test.rb | ||
reflection_test.rb | ||
representation_test.rb | ||
strict_loading_test.rb | ||
variant_test.rb | ||
variant_with_record_test.rb |