Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Support strict_loading on association declarations #38541
Raise an error if attempting to load a record from an association that has been marked as
class Developer < ApplicationRecord has_many :projects, strict_loading: true end dev = Developer.first dev.projects.first # => ActiveRecord::StrictLoadingViolationError: The projects association is marked as strict_loading and cannot be lazily loaded.
This is a follow up to the work done on #37400. It effectively allows you to declare that specific relations should always be treated as if the parent were marked in strict mode.