Skip to content

Commit

Permalink
docs: add strict_loads? to polymorphic relationships guide
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Jan 30, 2025
1 parent af5a1cf commit a325ac7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions documentation/how-to/polymorphic-relationships.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ defmodule GetAccountImplementation do
[:checking_account, :savings_account]
end

# This ensures that all attributes are selected by default
# on the related loads we depend on.
def strict_loads?, do: false

def calculate(records, _, _) do
Enum.map(records, &(&1.checking_account || &1.savings_account))
end
Expand Down

0 comments on commit a325ac7

Please sign in to comment.