[eluser]OverZealous[/eluser]
@NachoF
join_related:
Join fields from a related class. In other words, I can include the
name field of the model
Group while querying my
Users. This allows you to get information from related models all in one query. It's
really useful when querying data for a table, because you avoid running many queries to pull in all the data.
Join related includes the specified fields as
<related_field>_<column_name>. You specify which related model in the first parameter, and which columns using the second parameter.
include_join_fields:
This allows you to include fields that are stored on a join table. In this case, you might want to track how many times a specific user has viewed a specific post, or something similar. You related the user like normal, but you can include extra columns on the join table that you can query, view, and update using
where_join_field,
include_join_fields, and
set_join_field respectively.
I had already create
join_related when I added the join table methods, so the names are a little confusing. I didn't want to rename it, because it would break code (or require rewrites).
If I did rename it, I might rename it
include_related_fields to make it consistent with the other one. (I might even make the second parameter optional, although that is not very efficient.)