A CLI for working with Postgres databases. Ships with auto-completion and syntax highlighting.
You can do so much more than console.log(...)! See the attached link for a great breakdown of what the developer...
Rails guide that covers PostgreSQL-specific column types and usages for Active Record. You should especially keep in mind the...
Rails migrations allow you to use a change method whose calls are automatically inverted for the down path. However, if...
Creating records in specs can be so fast that two records created instantly after one another might have the same...
We upgraded a Rails 2 application to Rails 3.2 and Ruby 2.1, changed the mysql adapter from mysql to mysql2...
p ActiveRecord::Base.connection.indexes(:table_name)
To avoid n+1 queries, you want to eager-load associated records if you know you need to access them...
Styling HTML email is painful. Tables, inline CSS, unsupported CSS, desktop clients, web clients, mobile clients, various devices, various providers...
edge_rider is Power tools for ActiveRecord relations (scopes). Please note that some of the functions edge_rider provides have...
Directly from the MySql docs: There are three likely causes for this error message. Usually it indicates network connectivity trouble...
Open a MySQL root shell and use this command: PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 3 DAY) + INTERVAL 0...
When you have a string containing umlauts which don't behave as expected (are not matched with a regexp, can...
ActiveRecord caches results of SQL queries. If you want to discard the cached results for one model, you can call...
When you want the table headers to always stay around (e.g. because that table is huuuge), use the code below...
Declare an enum attribute where the values map to integers in the database, but can be queried by name.
When you, as a developer, look at the choices used to build a particular application, you’re blown away at...
By default, Rails' validates_uniqueness_of does not consider "username" and "USERNAME" to be a collision. If you use MySQL...
Store each models version in a separate table class Post < ActiveRecord::Base has_paper_trail :class_name => 'PostVersion' end
Just found out about a great feature in Rails that seems to be around since Rails 2. Start a console...
You might have a table without a primary key set in MySQL. You can fix this by adding a primary...
For reasons that completely escape me, MySQL 5.x limits UTF-8 strings to U+FFFF and smaller.
Like in any language, a FLOAT will eventually corrupt data due to rounding errors. Please use DECIMAL, which has well...
Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass...