stackoverflow.com

When you want to find out the data type of an attribute, you can just use ActiveRecord's columns_hash...

dev.mysql.com

Usually our mysql queries are not case sensitive. In order to query case sensitive, you can use the mysql COLLATE...

Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that...

Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox...

Rails has always included a scaffold script that generates a default controller implementation for you. Unfortunately that generated controller is...

It is good programming practice to Don't Repeat Yourself (or DRY). In Ruby on Rails we keep our code...

I recently experienced the error ActiveRecord::StatementInvalid: Mysql2::Error: closed MySQL connection. Apparently this happens when there is a timeout...

So you're switching to PostgreSQL from MySQL? Here is some help... General hints on PostgreSQL \? opens the command overview...

rubydoc.info

Preface: Normally, you would not need this in integrations tests (probably that's why it is so hard to achieve...

Consul 0.10.0 now allows multiple power mappings for nested resources. When using nested resources you probably want two power

In order to keep the controllers directory tidy, we recently started to namespace controllers. With the :controller option you can...

apidock.com

When you're writing migrations that do more than changing tables (like, modify many records) you may want some output...

makandracards.com

So you're hunting down a regression (or just a bug) and want to use git bisect to find out...

We tend to use database transactions as a magic bullet to get rid of all our concurrency problems. When things...

Consul 0.9 comes with many new features to optimize powers that only check access to a given record. e.g. Power.current.post...

blog.bigbinary.com

Remember why preloading associations "randomly" uses joined tables or multiple queries? If you don't like the cleverness of this...

1. Saving files to a directory that is not shared between deploys or servers If you save your uploads to...

Active Record's select method allows you to make use of the power of MySQL select statements. On the one...

Merge requests are often rejected for similar reasons. To avoid this, before you send a merge request, please confirm that...

Do it like this: attribute :active, Virtus::Attribute::Boolean Long story In Virtus you define attribute with their type...

Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...

highscalability.com

Awesome battle report from Pinterest trying to scale their setup using different approaches. When you push something to the limit...

github.com

When using the json gem, you might run into this error when using JSON.parse: >> json = 'foo'.to_json >> JSON.parse(json...