Made rails 4 compatible and updated files