Deal with certain travis CI failures

Posted Almost 5 years ago by Tobias Kraze.

Travis changed their default distribution from Ubuntu 14.04 (trusty) to 16.04 (precise). This might break your test setup for new...

Documenting your Rails project's Node.js version in .nvmrc

Posted Almost 5 years ago by Henning Koch.

Not all versions of Node.js are compatible with each other. Also npm packages may require a minimum or maximum version...

How to recognize CVE-2019-5418

Posted Almost 5 years ago.

If you get requests with values for formats like this: {:locale=>[:de], :formats=>["../../../../../../../../../../etc/services{{"], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby...

Capybara: Testing file downloads

Posted Almost 5 years ago by Emanuel.

Download buttons can be difficult to test, especially with Selenium. Depending on browser, user settings and response headers, one of...

Self-expiring URLs with Apache

Posted Almost 5 years ago by Tobias Kraze.

When delivering non-public uploaded files (images, documents etc), one has to decide whether and how to do authorization. The...

Function Composition in Ruby

Posted Almost 5 years ago by Henning Koch.
thoughtbot.com

Along with a number of other cool new features and performance improvements, Ruby 2.6 added function composition to the Proc...

Vortrag: Elasticsearch Grundlagen und Rails-Integration mit searchkick

Posted Almost 5 years ago by Tobias Kraze.

Was ist Elastic? Suchmaschine, basierend auf Apache Lucene größtenteils Open-Source einige kommerzielle Features ("Elastic Stack", früher "X-Pack") Zugriffsrechte...

Tod: A Gem for handling daytime without a date

Posted Almost 5 years ago by Jakob Scholz.

Tod is a gem for working with daytimes. Another additional gem? Thus SQL has a time datatype for storing time...

When reading model columns during class definition, you must handle a missing/empty database

Posted Almost 5 years ago by Arne Hartherz.

When doing some meta-programming magic and you want to do something for all attributes of a class, you may...

ActionMailer: Previewing mails directly in your email client

Posted About 5 years ago by Michael Leimstädtner.

In Rails, we usually have a mailer setup like this: class MyMailer < ActionMailer::Base def newsletter mail to: 'receiver@host.tld',

Why you can't use timezone codes like "PST" or "BST" for Time objects

Posted About 5 years ago by Arne Hartherz.

Rails' ActiveSupport::TimeWithZone objects have both a timezone code and offset, e.g. Thu, 28 Mar 2019 16:00:00 CET...

rails_state_machine 1.1.2 released

Posted About 5 years ago by Arne Hartherz.

Fixed bugs where calling valid? would change the record's state.

How to fix parallel_tests with Redis on powerful machines

Posted About 5 years ago by Daniel Straßner.

When you have a powerful machine with many CPU cores, you might run into an error like

Rails: How to get URL params without routing parameters (or vice versa)

Posted About 5 years ago by Arne Hartherz.

Rails' params hash contains any request parameters (URL parameters or request payload) as well as routing parameters like :controller, :action...

Carrierwave processing facts

Posted About 5 years ago by Dominik Schöler.

Class-level process definitions are only applied to the original file Versions are generated based on the processed original file...

Trigram indexing as an alternative to PostgreSQL fulltext search

Posted Over 5 years ago by Tobias Kraze.

For searching in large database tables we usually use PostgreSQL's fulltext search capabilities. While this works reasonably well for...

JavaScript without jQuery (presentation from 2019-01-21)

Posted Over 5 years ago by Henning Koch.

We want to move away from jQuery in future projects Motivations are performance, bundle size and general trends for...

How to drop all tables in PostgreSQL

Posted Over 5 years ago by Arne Hartherz.
tableplus.io

To remove all tables from a database (but keep the database itself), you have two options. Option 1: Drop the...

Regular tasks for long-running projects

Posted Over 5 years ago by Dominik Schöler.

When projects run for many years, they require special regular maintenance to stay fresh. This kind of maintenance is usually...

ActiveJob Inline can break the autoloading in development

Posted Over 5 years ago by Emanuel.

We figured out, that ActiveJob Inline might lead to autoloading problems in development. The result was an exception when running...

Devise: Don't forget to lock users with soft delete

Posted Over 5 years ago by Emanuel.
github.com

There are two ways to lock a user in devise. Using the lockable module Customizing the user account status validation...

RSpec 3 allows chaining multiple expectations

Posted Over 5 years ago by Arne Hartherz.
relishapp.com

When you are using lambdas in RSpec to assert certain changes of a call, you know this syntax: expect { playlist.destroy...

Minify Font Awesome fonts with webpack

Posted Over 5 years ago by Tobias Kraze.

Font Awesome 5 is a comprehensive solution for vector icons on your website. Originally, Font Awesome came as an icon...

How to let passenger restart after deployment with capistrano

Posted Over 5 years ago by Kim Klotz.
github.com

Phusion Passenger changed the way how it gets restarted several times. Through the project's history, these all were valid...