Posted almost 2 years ago by Dominik Schöler.

As an application exists, data accumulates. While you'll be loosely monitoring the main models' record count, some supportive database...

Posted over 8 years ago by Henning Koch.

validates_uniqueness_of is not sufficient to ensure the uniqueness of a value. The reason for this is that in...

Posted about 4 years ago by Henning Koch.

I often see the use of || to set a default value for a variable that might be nil, null or...

Posted almost 8 years ago by Henning Koch.

Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that...

Posted about 7 years ago by Arne Hartherz.

When you have a string containing umlauts which don't behave as expected (are not matched with a regexp, can...

Posted almost 6 years ago by Henning Koch.

Spreewald comes with a selector_for helper that matches an English term like the user's profile into a CSS...

Posted almost 4 years ago by Emanuel De.

There are many approaches out there how you can import data from a legacy application to a new application. Here...

Posted over 8 years ago by Henning Koch.

Selenium cannot reliably control a browser when its window is not in focus, or when you accidentally interact with the...

Posted almost 4 years ago by Arne Hartherz.

RSpec allows defining methods inside describe/context blocks which will only exist inside them. However, classes (or any constants, for that...

Posted over 10 years ago by Arne Hartherz. kernel.org

Git allows you to do a binary search across commits to hunt down the commit that introduced a bug.

Posted almost 11 years ago by Henning Koch. github.com

An alternative to this technique is using VCR. VCR allows you to record and replay real HTTP responses, saving you...

Posted almost 2 years ago by Stefan Langenmaier.

MariaDB (and MySQL) is released in different versions with different behaviors. For backwards compatibility this can be managed with the...

Posted about 6 years ago by Henning Koch. github.com

When working with ActiveType you will often find it useful to cast an ActiveRecord instance to its extended ActiveType::Record...

Posted almost 4 years ago by Arne Hartherz.

When localizing model attributes via I18n you may run into errors like this: I18n::InvalidPluralizationData: translation data {...

...} can not be...

Posted over 8 years ago by Thomas Eisenbarth.

Ruby has two different ways to match the start and the end of a text: ^ (Start of line) and $ (End...

Posted almost 2 years ago by Emanuel De.

You can share a state in Ruby with global variables. Even if you should avoid them whenever possible, for debugging...

Posted over 9 years ago by Arne Hartherz.

Basically, you now need to know if your project uses a "real" time zone or :local, and if config.active_record.time_zone...

Posted over 4 years ago by Emanuel De. evilmartians.com

Adding a gem means you take over the liability towards the external code. Checklist Based on "To gem, or not...

This website uses short-lived cookies to improve usability.
Accept or learn more