4bb737fd03d9f445a436fefd00a296e3
About Tushar Titame
I am software enthusiast. I like to work on web frameworks like Ruby on Rails, MS.Net. As a hobby I love visiting beautiful places and photography.
All blog articles by Tushar Titame

Before starting with setup process lets first briefly go through what Sidekiq is? and how it works? Sidekiq provides very handy and efficient way to perform most of our work asynchronously in a job. Provided Redis cache connection to it, it serializes all job parameters in Redis and deserializes it while picking it up for execution based on priority of job as it uses queue data structure to store each job in particular queue specified in job and each queue has its priority defined as high,...

Read complete blog post

4bb737fd03d9f445a436fefd00a296e3
Tushar Titame

Sendgrid provides email service which we can use for sending emails from our app and we can even track every details of any email sent through our Sendgrid account like whether it is delivered, opened, dropped and details of unsubscribed email addresses etc.

There are also API endpoints provided by Sendgrid to access user subscribe/unsubscribe related data and email event data with respect to emails sent through your sendgrid account for which documentation link is provided at bottom.

To...

Read complete blog post

Recently while working on one of our project, there was a requirement of scheduling background job for processing some stuff once record is saved. So I written enqueue logic for job in after_save callback of record. But then job started giving unexpected results.

After long time of debugging I found that job was not able to fetch record from db which was just saved and after some researching on it I got to know that sometimes job scheduled in after_save callback fails to access that record as...

Read complete blog post

Recently while working on one of our project there was an requirement of tracking count of records associated with has-many association. But also there was "is_hidden" flag set on some of the records which I do not suppose to count in counter as those were hidden records. So default counter_cache option of rails active-record was not appropriate in this case which automatically counts and caches the number of associated records and keeps cache updated. Refer following model code for this.

...

Read complete blog post

Recently in one of our project there was a requirement to send SMS notification to users and task was to perform this functionality as background job using delayed job service. I wrote following code for sending SMS notifications to user and it was working fine. Then I just did one liner change in my code to process send_sms method asynchronously using handle_asynchronously method of delayed job and thought it will work as expected.

 attr_reader :client, :sender, :recepient,...

Read complete blog post

Recently we had requirement to generate weekly sales report in one of the E-commerce apAs we were using Stripe services for payment handling, I studied some of Stripe API methods and how it actually works. So in this article I will briefly explain how we can handle payment through Stripe and how we can get sales data from Stripe.

Firstly these are few basic steps to start using Stripe API:

1) Add 'stripe' gem to your gemfile.

2) bundle it

3) You will get secret and public key pairs for live...

Read complete blog post

Recently while working on one of our app there was a scenario where I was expecting text-field input as multiple values from predefined list of values in database. Also, user should get suggestion for matching values from database as he types in that text-field and value which do not exist in database should not be allowed to enter.

I found one perfect solution on this scenario, that is jquery-tokeninput

What I did to integrate plugin is very simple and as follows-

1) Add jquery.tokeninput.js...

Read complete blog post