Insights and Strategies for upgrading Ruby on Rails applications

For the past few months at Kiprosh, we've done versions upgrade of multiple mid to large scale Ruby on Rails applications. One of them was running Rails version 3.2.22. That's where we found out that, we need to make a lot of changes in our codebase to run our application on version 4.0. Hence, we thought to write this blog post to share our insights and recommended strategies for upgrading such mid to large Rails applications.upgrading Ruby on RailsRails guides provide us a brief information on how to upgrade the Rails app, but we need to

How to store emoji characters in MySQL database of a Ruby on Rails application

Emoji has become an essential part of communication in our digital lives. Hence, as developers, our applications should provide first-class support to them. In this blog post, we will explore how to store Emoji's in MySQL database.In one of our internal Ruby on Rails web application using MySQL database, we were facing an issue whenever a user tried to insert an emoji in the text of an article. The "save" functionality in UI ran infinitely (ajax) and logs were reporting following errors:ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xF0\x9F\x98\x8A ...' for column 'content' at

How we automated our recruitment process using Zapier, Airtable & Trello

As a tech organisation, we always strive to find suitable talent for available positions, and then move them quickly through the application funnel, from sourcing to hiring. The goal is to onboard a potential candidate as fast as possible. In this endeavor, we decided to automate our recruitment processes so that the overall time to screen, interview and to release an offer is relatively faster. Background Interested candidates apply on our website through careers page. We have a referral program for our associates so it also resulted in wider interest. We also receive direct applications through email on careers@kiprosh.

Generating PDF files from HTML content

Although nowadays we have Email, SMS services integrated in most of web applications, sometimes there could be need of documentation for future reference which users may want to reuse later based on their need. Similar requirement we had in one of our web application where we wanted to provide option to user to generate single or bulk PDF files out of any HTML templates they have in their account. There was different features around the generation of PDF document but major work was involved in generation of PDF out of HTML which is also not difficult task when we have

Google Drive Folder Sync - Webhooks

In my previous post, we discussed how we were able to sync our files and folders with Google Drive. You can refer the post here - http://kiprosh.com/blog/google-drive-file-upload-pre-generated-file-id-for-uploads. Once we were done with the sync setup - next step is to ensure sync was accurate and timely i.e changes made in our application are accessed instantly in Google and more important changes made in Google are available in our application. We needed this without an impact on the performance - without polling Google to find out updates and nor writing any custom logic comparing timestamps to

Google Drive File Upload - Pre Generated File Id for Uploads

This is a one of the part of some of articles I wanted to publish for the things I learned or had less of web content when we were integrating a feature for Google Drive Folder Sync. Basic goal was to connect a Google Drive Folder and upload files from our app to Google and vice-versa. In this article we want to focus mainly on the uploads from our application. Why do we need the Pre Generated Id for Files? We are using Google Drive API V3 for this feature - https://developers.google.com/drive/v3/web/about-sdk. The

Deployment of Rails App on DigitalOcean with Capistrano, Nginx and Passenger - Part 2

In the previous article, we have seen how to configure DigitalOcean Droplet. Now let's proceed further to set up our application repository and Ngnix with Phusion Passenger on the DigitalOcean droplet. 1. Install RVM and Ruby We will install ruby using Ruby Version Manager(RVM) as it gives more flexibility to manage multiple ruby versions on the same system over rbenv, chruby, etc. Import RVM GPG key, before installing RVM: gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 Then, install RVM: curl -sSL https://get.rvm.io | bash -s stable Load RVM script and run requirement command to manage the

Debugging tips and tricks in Ruby and ROR - Part 1

In software development you are destined to deal with lots of code that is not written by you. What would be more stressful than debugging the code that you barely understand. You might have been in the situation where you have been assigned a bug and you have to traverse through lots of file which you have no idea of, just get to root cause of the issue. Being in these situations many times, I have learned few tips and tricks for debugging and would like to share it here. **Checking where the method causing a problem exists.** In some

Encoding Problems in Ruby

String encoding is something that we don't really think until we see Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT Or when users complains about missing special characters like "’" (apostrophe copied from Microsoft Word) or when "菜医生" becomes "иЏњеЊ»з”џ". Before we go into encoding problems, lets understand what encoding is. A string can be considered as an array of bytes: irb(main):001:0> "world".bytes => [119, 111, 114, 108, 100] Here 119 means w, 111 means o and so on. This relationship between bytes and characters is

Hubspot CRM - how, what and benefits

Recently while working on one of our project we came across requirement where we wanted Hubspot integration with our application for ease of sales team to manage user's data and understand their interactions and trends in application. I will quickly explain few things about Hubspot here in my article. What is Hubspot? In brief, Hubspot is a CRM which helps you monitor and fine tune many things regarding your application. Based on my analysis I will shortly list down few most important of them in order to give you more insights about it - Closely monitoring user interactions with your