updated checks of environment with Rails.env by Rails.env methods
updated test with proper change of Rails.env during test
Merge pull request #2665 from akshaymohite/optimization-fixes

updated checks of environment with Rails.env by Rails.env methods
FEATURE: vBulletin importer
FIX: vanilla importer when private topic had no first post (WAT)