Modified event.rb to work with Rails 4