Geordi 1.0 features a command line application geordi, that holds most of Geordi's previous commands. New features
Add gem 'database_cleaner' to your Gemfile. Then: Cucumber & Rails 3+ # features/support/database_cleaner.rb DatabaseCleaner.clean_with(:deletion) # clean once, now DatabaseCleaner.strategy = :transaction...
Sequel is an awesome ORM such as ActiveRecord. The linked article describes how easily you can implement and use materialized...
In the tradition of our PostgreSQL cheat sheet for MySQL lamers, here is a cheat sheet for Jasmine when you...
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...