make it compatible for Rails 3 and Rails 4..