fixed scope issue for Rails 4.0