A solid foundation for analytics on Rails