The easiest way to freeze or travel through time in a Jasmine spec is to use the built-in jasmine.clock...
The Bullet gem is designed to help you increase your application's performance by reducing the number of queries it...
The migration DSL now supports adding and removing foreign keys. They are dumped to schema.rb as well. At this time...
tl;dr: Use event.currentTarget unless you are absolutely certain that you need event.target. Since it hasn't been written down...
Your after_commit callbacks will not know about changes, as Rails discards them when committing. The linked article shows a...
This blew my mind today: 12 Little-Known CSS Facts 12 Little-Known CSS Facts (The Sequel) Please make sure...
Sometimes you need to run background jobs that you can't make important guarantees about - they may run out of...
Large projects usually have large test suites that can run for a long time. This can be annoying as running...
In most of our applications, users have their first and last name stored in separate columns. However, specifying them separately...
Disabling auto-complete in login forms is probably a bad idea, since it encourages weak passwords. If you are still...
In my RubyMine I have recorded two macros for debugging and linked them to some keyboard shortcuts. Since I believe...
When working with ActiveType you will often find it useful to cast an ActiveRecord instance to its extended ActiveType::Record...
Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead.
There is no such thing as a "default order" of rows in database tables. For instance, when you paginate a...
HTTP/2 will make our applications faster, simpler, and more robust—a rare combination—by allowing us to undo many of...
ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a...
All major browsers (IE8+, FF3.5+, Safari 4+, any Chrome) support sessionStorage, a JavaScript storage object that survives page reloads and...
When using Savon to connect a SOAP API, you may want to use Savon::SpecHelper to mock requests in your...
Datetime picker that offers: simple UI without a specific framework several of customization options allows custom date/time validations Localization happens...
Jasmine has a jasmine.clock() helper that you can use to travel through time and trigger setTimeout and setInterval callbacks:
Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g...
When you want to UPDATE a table with information from an associated table, you can JOIN the associated table into...
Several Rails migration methods accept index: true as an option to create an index. In some cases (like #add_column...
TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby...