Here we are, this year too. It’s one week to Christmas and 2016 is just around the corner.
Continue reading “It’s Christmas time!”
ActiveRecord tips: when to use select in place of pluck
As you probably know ActiveRecord allows arrays as arguments of conditions. I remember this feature at least since Rails 2…
Continue reading “ActiveRecord tips: when to use select in place of pluck”
Add Two Factor Authentication to your Rails app
Recently we started adding two-factor auth to all our apps by default. And obviously there is a gem for this: devise-two-factor
In this article I guide you through the setup of two-factor authentication using this gem. Continue reading “Add Two Factor Authentication to your Rails app”
The Paranoia gem
If you didn’t know it yet, paranoia is a gem that handles the soft deletion for your ActiveRecord models.
Continue reading “The Paranoia gem”
Redis has now built in GEO APIs
This week @antirez merged the GEO APIs developed by Matt Stancliff in Redis. They will be released with Redis 3.2.
IMHO this is really a great addition to Redis. At the moment redis.io still doesn’t list the new commands, but you can check the website of the original GEO API implementation to have an insight of the commands.
Lotus – one year later
One year ago @jodosha released Lotus 0.1.0, a small and minimalistic web ruby framework. Even at that early stage it looked like a very interesting product because of its solid MVC approach.
Continue reading “Lotus – one year later”
Remember to tune spring before giving up
Spring is a greatest addition to the Ruby on Rails standard distribution. but if you haven’t read its readme carefully you could find yourself with weird issues. It’s time to know how it works and how you can prevent it to ruining your day.
Continue reading “Remember to tune spring before giving up”
Let PostgreSQL do its work
Placing things in the right place is important. Rails devs tend to forget this, because Rails gives them some really good helpers.
For example, take a uniqueness validation. Doing the validation on the Rails side can produce duplicated records when there are two concurrent requests. So the best way is to handle this type of validation on the DB side.
Same thing with the counter cache column. Defining it on the Rails side may seem the right solution, but this choice will affect performances. Better to handle it via PostgreSQL.
I found a series of posts about these portings by Sean Huber: