instance method
strict_loading!
Ruby on Rails 6.1.7.10
Since v6.1.7.10Signature
strict_loading!()
Sets the record to strict_loading mode. This will raise an error if the record tries to lazily load an association.
user = User.first user.strict_loading! user.comments.to_a => ActiveRecord::StrictLoadingViolationError
Source
# File activerecord/lib/active_record/core.rb, line 702
def strict_loading!
@strict_loading = true
end
Defined in activerecord/lib/active_record/core.rb line 702
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Core