Fixed the WhiningNill deprecation fix
Fixed default scope deprecation warning
Fixed some deprecation warnings
Fixed the last deprecation warnings for order and where
Merge branch 'rails4' of https://github.com/jvanbaarsen/gitlabhq into jvanbaarsen-rails4
Fixed mistake and mock warning

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Merge branch 'jvanbaarsen-rails4' into rails4
Merge branch 'rails4' of github.com:gitlabhq/gitlabhq into rails4