anchor.diff:          _ -> {error, Errors2}
       end.
   
  +%% @spec validate_record_constraints( BossRecord ) -> ok | {error, [ErrorMessages]}
  +%% @doc Validate the given BossRecord without saving it in the database.
  +%% `ErrorMessages' are generated from the list of constraints returned by the BossRecord's
  +%% `constraints_create/0' or `constraints_update/0' function (if defined).
  +%% The returned list should consist of `{ConstraintFunction, ErrorMessage}' tuples,
  +%% where `ConstraintFunction' is a fun of arity 0
  +%% that returns `true' if the record is valid or `false' if it is invalid.
  +%% `ErrorMessage' should be a (constant) string which will be included in `ErrorMessages'
  +%% if the `ConstraintFunction' returns `false' on this particular BossRecord.
  +validate_record_constraints(Record, IsNew) ->
  +    Type = element(1, Record),
  +    Function = case IsNew of
  +                   true -> constraints_create;
  +                   false -> constraints_update
  +               end,
  +    Errors = case erlang:function_exported(Type, Function, 1) of
  +                 true -> [String || {ConstaintFun, String} <- Record:Function(), not ConstaintFun()];
  +                 false -> []
  +             end,
  +    case length(Errors) of
  +        0 -> ok;
  +        _ -> {error, Errors}
  +    end.
  +
   %% @spec validate_record_types( BossRecord ) -> ok | {error, [ErrorMessages]}
   %% @doc Validate the parameter types of the given BossRecord without saving it
   %% to the database.
  
positive.code:                         FoundOldRecord -> {false, FoundOldRecord}
                      end
              end,
              HookResult = case boss_record_lib:run_before_hooks(Record, IsNew) of
                  ok -> {ok, Record};
                  {ok, Record1} -> {ok, Record1};
                  {error, Reason} -> {error, Reason}
              end,
              case HookResult of
                  {ok, PossiblyModifiedRecord} ->
                      case db_call({save_record, PossiblyModifiedRecord}) of
                          {ok, SavedRecord} ->
                              boss_record_lib:run_after_hooks(OldRecord, SavedRecord, IsNew),
                              {ok, SavedRecord};
                          Err -> Err
                      end;
                  Err -> Err
  
negative.code: 
  %% @spec validate_record( BossRecord ) -> ok | {error, [ErrorMessages]}
  %% @doc Validate the given BossRecord without saving it in the database.
  %% `ErrorMessages' are generated from the list of tests returned by the BossRecord's
  %% `validation_tests/0' function (if defined). The returned list should consist of
  %% `{TestFunction, ErrorMessage}' tuples, where `TestFunction' is a fun of arity 0
  %% that returns `true' if the record is valid or `false' if it is invalid.
  %% `ErrorMessage' should be a (constant) string which will be included in `ErrorMessages'
  %% if the `TestFunction' returns `false' on this particular BossRecord.
  validate_record(Record) ->
  