geekytidbits.com

To retrieve only unique combinations of the selected attributes: You can omit rows, where all selected columns are equal with...

A severe bug was found in ImageMagick by Bryan Gonzalez from Ocelot Team. It allows to embed the content of...

Rails includes milliseconds in Time / DateTime objects when rendering them as JSON: JSON.parse(User.last.to_json)['created_at'] #=> "2001-01-01...

Sometimes, the rails dev server doesn't terminate properly. This can for example happen when the dev server runs in...

After upgrading to Rails 6.1.7.2 one of our apps printed a wall of warnings while booting: /var/www/app/shared/bundle/ruby/2.6.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:68: warning: already...

DevOps Curriculum

Mit SQL spricht man mit relationalen Datenbanken. Ziele Verstehe die folgenden SQL Befehle SELECT WHERE ORDER INNER JOIN, LEFT JOIN...

kukicola.io

Using ActiveRecord's #signed_id and .find_signed methods you can create URLs that expire after some time. No conditionals...

When an object is created / updated, various callbacks are executed in this order: before_validation after_validation before_save

bundler.io

Bundler so far ignored the version specified under BUNDLED_WITH in the Gemfile.lock. This had two annoying consequences:

Our CI setup frequently sees this error while running yarn install: yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages...

makandra dev

In a Jasmine spec you want to spy on a function that is imported by the code under test. This...

When changing the glibc version, it's possible that the upgrade also includes changes to how locales work.

github.com

Instead of cobbling together default settings in several different places as the issues arise, you can define them application-wide...

tl;dr You should decouple migrations from models by embedding models into the migration. To use STI in this scenario...

This can happen with a very simple model: class Note has_many :attachments end Everything looks normal: Note.all.to_a.size # => 8 Note.all.ids.size...

Large Rails projects tend to define multiple custom ways to format Dates or DateTimes. This often leads to duplicated format...

If you use third party APT sources you might end up with unmaintained packages after removing the external source or...

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

tl;dr Since Rails 7+ you can use ComparisonValidator for validations like greater_than, less_than, etc. on dates, numerics...

You can use ETags to allow clients to use cached responses, if your application would send the same contents as...

makandra dev

tl;dr git checkout is the swiss army of git commands. If you prefer a semantically more meaningful command for...

Ruby's standard library includes a class for creating temporary directories. Similar to Tempfile it creates a unique directory name...

tl;dr Since Rails 6+ you can use before? and after? to check if a date/time is before or after...

To allow HTTP 304 responses, Rails offers the fresh_when method for controllers. The most common way is to pass...