author avatar

akshay

Fri May 11 2018

Rails 5 prevents accidental halting of the callbacks. In order to explicitly halt, we can make use of throw(:abort) in the callback chain.
author avatar

akshay

Fri May 11 2018

Sidekiq by default does 25 retries (about 21 days) based on exponential back off formula ie. to retry multiple times with exponential delays. If need be, we can explicitly configure max_retries in sidekiq.yml.
author avatar

harshwardhan

Fri Apr 27 2018

while writing test for a parent component which renders child component based on some state/prop and if your child component is connected, always import unconnected child component and do assertion on that.
/code
import { ChildComponent } from 'path/to/component';

expect(component.find(ChildComponent).length).toBe(1);

//instead of
expect(component.find('ChildComponent').length).toBe(1);
author avatar

akshay

Mon Apr 23 2018

In Rails we can do two modes of locking that is 'Optimistic Locking' and 'Pessimistic locking'. 'Optimistic Locking' assumes that a database transaction conflict is very rare to happen and such locked records can still be read (Shared lock). It uses a version number of the record to track the changes. This can be used by adding a lock_version column to the table and then is handled automatically by Rails.
Whereas 'Pessimistic locking' assumes that database transaction conflict is very likely to happen. It locks the record until the transaction is done (Exclusive lock). This can be done with ActiveRecord::Base#lock! or ActiveRecord::Locking::Pessimistic#with_lock.
author avatar

mrinmoy

Fri Apr 20 2018

a decent spreadsheet writer gem for ruby, https://github.com/felixbuenemann/xlsxtream, ran some rough benchmarks, and this one is the fastest and lowest memory consuming gem. although not feature complete.

Showing 56 to 58 of 69 results