Handle compatibility for Rails 3