blog.cloudflare.com

Two weeks ago, Cloudflare was struck by a global outage that lasted ~30 minutes. The incident was rooted on a...

If you migrate a Rails application from Sprockets to Webpack(er), you can either transpile your CoffeeScript files to JavaScript...

If you use transactional_fixtures or the database_cleaner gem with strategy :transaction, after_commit callbacks will not be fired...

...polymorphic association. class Event < ApplicationRecord has_many :letters, as: :record end class Letter < ApplicationRecord belongs_to :record, polymorphic: true end event = Event.new.letters.build event.save! # => ActiveRecord::RecordInvalid: Validation failed: Record must exist...

...member', :home_page end It has some limitations: Only works for singular member references ("belongs to"), not for a collection of references ("has many") No support for deletion (but could...

...when you run a Selenium test with Capybara. This will help you understand "impossible" behavior of your tests. When you run a Rack::Test (non-Javascript) test with Capybara, there...

...you. But sometimes the complexity will bleed through, causing your tests to show "impossible" behavior. Here is some unexpected behavior caused by the interaction of threads and processes:

...skipping asset compilation when assets have not changed? Turns out there is an even better way to speed up Capistrano deployments with asset compilation – and it's even simpler.

We had a strange behaviour on one of our mariadb-servers: Everyday at around midnight we saw that the root-account on one of our servers is trying to access...

With cd .. you can navigate one directory up from the one you are at now. If you use that a...

In Ruby you can communicate between processes with sockets. This might be helpful in tests that validate parallel executions or...

After updating Rubygems you see a wall of deprecation warnings like this: NOTE: Gem::SourceIndex#add_spec is deprecated, use...

When your JavaScript bundle is so massive that you cannot load it all up front, I would recommend to load...

Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...

Carrierwave includes some handy helper methods you can use to resize your images. Here is a quick summary of them...

# Capitalized expressions are intended to be replaced with YOUR values describe 'SERVICE', -> beforeEach -> module 'MODULE' module ($urlRouterProvider) -> # Prevent uiRouter's initialization, i.e. do not sync the current URL...

Capybara added a deprecation warning in version 3.35.3 (version from 2019) that shows up if your selector is not of...

When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...

When storing files for lots of records in the server's file system, Carrierwave's default store_dir approach may...

makandra dev
poinz.herokuapp.com

If you are using scrum in a project you might be familiar with planning poker, a playful way to agree...

...issue with this pattern/approach. What's happening? Consider these classes: class Post < ActiveRecord::Base belongs_to :thread def thread_title thread.title end end class Thread < ActiveRecord::Base has_many :posts...

...post.thread is not actually a Thread even though looking at its class makes you believe so: post.thread.class => Thread Its real class is ActiveRecord::Associations::BelongsToAssociation which is sometimes exposed, for...

...being used by default (which may be annoying). Here is how to do that. Beware: By following the steps below, you will drop and recreate your cluster. You will lose...

...As an example, we will be modifying 9.5 main (running on port 5435) below. Become a PostgreSQL superuser sudo su postgres Backup entire database pg_dumpall -p 5435 > 5435.sql

When such a virtual attribute should contain integer values you might get unexpected behavior with forms, because every param is a string and you don't get the magic...

...guest from the CD, open a terminal (on the guest, not the host!) and become root: sudo su fdisk -l to see the disk information. \ There should be one drive...

accepts_nested_attributes_for :children validates_associated :children end class Child < ApplicationRecord belongs_to :parent, inverse_of: :children end class Child::AsForm < ActiveType::Record[Child] change_association :parent...

...AsForm record with nested Child::AsForm records, the children will not be saved. This behavior also applies to the case where you override the association with has_many :children,...

...and...