makandra dev
github.com

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...

leomayleomay.github.io

Your after_commit callbacks will not know about changes, as Rails discards them when committing. The linked article shows a...

makandra dev

This blew my mind today: 12 Little-Known CSS Facts 12 Little-Known CSS Facts (The Sequel) Please make sure...

makandra dev
github.com

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...

github.com

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.

postgresql.org

There is no such thing as a "default order" of rows in database tables. For instance, when you paginate a...

chimera.labs.oreilly.com

HTTP/2 will make our applications faster, simpler, and more robust—a rare combination—by allowing us to undo many of...

makandra dev
api.rubyonrails.org

ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a...

caniuse.com

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...

makandra dev
semaphoreci.com

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...

bevacqua.github.io

Datetime picker that offers: simple UI without a specific framework several of customization options allows custom date/time validations Localization happens...

jasmine.github.io

Jasmine has a jasmine.clock() helper that you can use to travel through time and trigger setTimeout and setInterval callbacks:

gist.github.com

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...