Build the reverse_order on its proper method.

The reverse_order method was using a flag to control if the order should
be reversed or not. Instead of using this variable just build the reverse order
inside its proper method.

This implementation was leading to an unexpected behavior when using
reverse_order and then applying reorder(nil).

Example:
  Before
    Post.order(:name).reverse_order.reorder(nil)
    # => SELECT "posts".* FROM "posts"   ORDER BY "posts"."id" DESC

  After
    Post.order(:name).reverse_order.reorder(nil)
   # => SELECT "posts".* FROM "posts"
remove check for present? from delete_all

Passing in a blank string is a bug so there's no reason
to check for a blank string.
Rails.application should be set inside before_configuration hook

Fixes #14620
Merge pull request #14635 from eileencodes/remove-check-for-present

remove check for present? from delete_all method
Merge pull request #14634 from laurocaetano/fix_reorder

Build the reverse_order on its proper method.
Follow up to bbe7fe41 to fix enum leakage across classes.

The original attempt didn't really fix the problem and wasn't testing the
problematic area. This commit corrected those issues in the original commit.

Also removed the private `enum_mapping_for` method. As `defined_enums` is now a
method, this method doesn't provide much value anymore.
Ensure we are looking  with string keys