Ruby on Rails analytics engine