Revert "Fixed bug in ActiveRecordBase:;removeAllByType()"

This reverts commit 75d89a70b33ff8e89bd30c4c9ba0f1d170307f36.