Revised for our current ruby/rails versions