method

strict_loading

Importance_1
v6.1.3.1 - Show latest stable - 0 notes - Class: ActiveRecord::QueryMethods
strict_loading(value = true) public

Sets the returned relation to strict_loading mode. This will raise an error if the record tries to lazily load an association.

user = User.strict_loading.first
user.comments.to_a
=> ActiveRecord::StrictLoadingViolationError
Show source
Register or log in to add new notes.