Merge pull request #45018 from lucthev/lt/strict-false
Fix disabling strict_loading when enabled by default
This commit is contained in:
commit
df1e1bc35c
|
@ -923,7 +923,7 @@ module ActiveRecord
|
|||
preload_associations(records) unless skip_preloading_value
|
||||
|
||||
records.each(&:readonly!) if readonly_value
|
||||
records.each(&:strict_loading!) if strict_loading_value
|
||||
records.each { |record| record.strict_loading!(strict_loading_value) } unless strict_loading_value.nil?
|
||||
|
||||
records
|
||||
end
|
||||
|
|
|
@ -86,6 +86,7 @@ class StrictLoadingTest < ActiveRecord::TestCase
|
|||
def test_strict_loading_by_default
|
||||
with_strict_loading_by_default(Developer) do
|
||||
Developer.all.each { |d| assert d.strict_loading? }
|
||||
Developer.strict_loading(false).each { |d| assert_not d.strict_loading? }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue