Revert "Bugfix on the active record join statement with empty conditions"

This reverts commit 2cfbfc54dc68d9e7ed7c20af4cf7693736bbd447.