anchor.diff:              erl_syntax:function(erl_syntax:atom(HasOne),
                   [erl_syntax:clause([], none, [
                               first_or_undefined_forms(
  -                                has_many_application_forms(Type, ForeignKey, 1, id, false, Include)
  +                                has_many_application_forms(Type, QueryForms, 1, id, false, Include)
                               )
                           ])]))
       ].
  
positive.code:             erl_syntax:function(erl_syntax:atom("first_"++Singular),
                  [erl_syntax:clause([], none, [
                              first_or_undefined_forms(
                                  has_many_application_forms(Type, ForeignKey, 1, Sort, IsDescending, Include)
                              )
                          ])])),
          erl_syntax:add_precomments([erl_syntax:comment(
  
negative.code:             erl_syntax:function(erl_syntax:atom("last_"++Singular),
                  [erl_syntax:clause([], none, [
                              first_or_undefined_forms(
                                      has_many_application_forms(Type, QueryForms, 1, Sort, not IsDescending, Include)
                                  )
                          ])])),
          erl_syntax:add_precomments([erl_syntax:comment(
                      [
                          lists:concat(["% @spec last_", Singular, "(Conditions) -> ", Type, " | undefined"]),
                          lists:concat(["% @doc Retrieves the last `", Type,
                                  "' that would be returned by `", HasMany, "(Conditions)'"])])],
              erl_syntax:function(erl_syntax:atom("last_"++Singular),
                  [erl_syntax:clause([erl_syntax:variable(?PREFIX++"Conditions")], none, [
                              first_or_undefined_forms(
                                      has_many_application_forms(Type, QueryFormsWithConditions, 1, Sort, not IsDescending, Include)
                                  )
                          ])]))
      ].
  