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...
sslscan is a nice tool to show details about TLS/SSL connections: ~> sslscan some-host-at.makandra.de Testing SSL server some-host-at.makandra.de on port 443...
Capistrano 3 is a major rework of the framework and requires several adjustments to your deploy configuration files. The biggest...
FactoryBot.define do factory :parent do transient do child_name nil child_allowed_to_drive false end child do association(:child...
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...
When using send_file (for example for attachments of any kind), make sure your application knows the correct mime types...
# Given the following models class Image < ActiveRecord::Base has_many :album_images has_many :albums, through: :album_images
When ending a Selenium test Capybara resets the browser state by closing the tab, clearing cookies, localStorage, etc.
You know that ActiveRecord caches associations so they are not loaded twice for the same object. You also know that...
Instead of this: Image.order('images.created_at DESC') You can write this: Image.order(created_at: :desc) Not only do you not...
It's generally not trivial to change a datetime's seconds, minutes, etc in SQL. Here is how it works...
Web applications can be used by multiple users at the same time. A typical application server like Passenger has multiple...
You can hook into Slack when using Capistrano for deployment. The slackistrano gem does most of the heavy lifting for...