...to choose smaller column sizes for performance (it won't matter until your project becomes big, so don't worry about it for now). Integer column lengths, mediumint, bigint, and...
...use this kind of call if your code is run by a background job. Better, don't use it at all. Exception Notifier 2.6 and 3 ExceptionNotifier::Notifier.background_exception_notification...
When you try to remove a non-existing index using remove_index, the migration will incorrectly pass without an error...
...to when precompiling your assets, and give your stylesheets access to all the regular bells and whistles (like asset_path, proper @imports etc): class DynamicStylesheetsController < ApplicationController def show logical_path...
Rails comes with a Rake task notes that shows code comments that start with "TODO", "FIXME", or "OPTIMIZE".
...the first time it was referred to, causing user to be loaded, which Ruby believed it had not seen before. And that caused a completely different spec to fail at...
There seems to be no built-in matcher in RSpec to check if a string contains terms in the desired...
...MKV container, H.264 codec, "0" constant rate factor and "veryslow" preset results in the best video quality. Peek Note The original peek project has been deprecated. If you are experiencing...
...feature-set to the original peek. If you don't insist on high the best video and you don't need audio recording, you could also use Peek, which is...
There was an issue with makandra_sidekiq < 0.2 concerning the stopping of Sidekiq. Sidekiq < 6 has two finishing timeouts: one...
tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...
Like you know from "How to tell ActiveRecord how to preload associations (either JOINs or separate queries)", you can tell...
a fraction, with a decimal point before it. I.e., -M5 becomes 0.5, and is thus the same as -M50%. Similarly, -M05 is the same as -M5...
If you want to get a deep understanding of how closures, blocks, procs & lambdas in Ruby work, check out the...
Spreewald now has a spreewald binary that lists all available steps, optionally filtering them. Example: $> spreewald # All Spreewald steps
To achieve this goal you have to setup the session store like the following example: MyApp::Application.config.session_store( :cookie_store...
...it with additional joins or conditions. We call this chaining scopes. In practice chaining becomes problematic when scope chains grow more complex. In particular having JOINs in your scope will...
...year is the week with January 4th in it. All days in this week belong to the year. This means that January 1st, 2nd and 3rd may or may not...
...the year. I am not sure which year December days in the same week belong to, I believe the week actually gets split into two calendar weeks in two different...
This will show you how to create a RSS feed that the Feed Validator considers valid. Note that RSS is...
Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.
...use Spreewald's "... in the HTML" meta step, or add this proxy step for better semantics: Then /^I should( not)? see "(.+?)" in the page source$/ do |negate, text|
...to intercept those RSS links, and Capybara internally remains on the previous page. This behavior can be circumvented with the following simple step: # Firefox seems to intercept RSS links. Use...
The step we used in the past (Then "foo" should not be visibile) doesn't reliably work in Selenium features...
If you want to make your Rails application be capable of sending SMTP emails, check out the action mailer configuration...
Converting string characters to or from their integer value (7-bit ASCII value or UTF-8 codepoint) can be done...
Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that...