Multi-line Ruby block in Haml
Haml can render multi-line Ruby code with the :ruby filter when puts sends generated output into the template response.
How to remove RSpec "old syntax" deprecation warnings
RSpec 3 deprecates :should expectations, causing warnings in older test suites and gems that need backward compatibility. RSpec.configure can re-enable both syntax styles.
Machinist's #make breaks on has_many associations when defining method `empty?`
Custom empty? on a has_many model can break Machinist collection building, creating records with the wrong foreign key. Use explicit association assignment instead.
MySQL 5.6 slightly changes DECIMAL data type
MySQL 5.6 changed DECIMAL storage and removed the old extra-digit behavior, so columns that relied on it may now need higher precision.
Mysterious "margin" below an image
Inline images can leave a small gap below them because they align to the text baseline, reserving space for descenders. vertical-align: middle or display: block removes the gap.
Why you see a GET "/__identify__" request in Capybara tests
Unexpected GET /__identify__ requests in Capybara test logs come from server readiness checks for Selenium-style drivers; Capybara answers them with middleware when no route exists.
PostgreSQL's OVERLAPS operator is not fully inclusive
PostgreSQL OVERLAPS treats date ranges as start <= time < end, so boundary dates are excluded and adjacent ranges do not match.
How to fix strangely disappearing or misbehaving forms
Nested form elements can vanish or submit the wrong data because browsers handle invalid form markup inconsistently, especially during Ajax updates.
FactoryBot: Passing attributes to associated records using transient attributes
FactoryBot transient attributes can pass custom values into associated records, letting parent factories build children with dynamic names and flags.
Cucumber: Detect if the current Capybara driver supports Javascript
Capybara.javascript_test? checks whether the current driver supports JavaScript, helping feature tests switch behavior for Selenium, capybara-webkit, Poltergeist, and custom drivers.
Different behavior for BigDecimal#floor in Ruby 1.8 and Ruby 1.9
BigDecimal#floor returns different types in Ruby 1.8 and 1.9 because it depends on Float#floor; a backport restores the Ruby 1.9 behavior on Ruby 1.8.
How to fix webpack-dev-server not found
bin/webpack-dev-server can fail with Yarn's "Command "webpack-dev-server" not found" error when dependencies are missing; yarn install --check-files restores the command.
Git error: "badTimezone: invalid author/committer line - bad time zone"
Malformed commit timestamps can make git clone fail with badTimezone when strict object validation is enabled. Disabling fetch.fsckobjects works around the error.
Why your previous developer was terrible
Judging legacy code by today’s needs hides the uncertainty faced during initial development, where many architecture and technology choices were made with incomplete information.
Recursively remove unnecessary executable-flags
Unexpected executable bits can appear on normal project files after copying from Windows or a Samba share. geordi remove-executable-flags clears them recursively with chmod -x.
Understand ActiveRecord::ReadOnlyRecord error
Records loaded with SQL fragments in :select or :joins become read-only in ActiveRecord to avoid saving rows with noncolumn attributes. :readonly => false overrides the safeguard.
How Exchange handles multipart/alternative emails
Exchange can discard the plaintext part of multipart/alternative email, leaving only HTML in normal mail accounts and complicating debugging.
Ruby: How to update all values of a Hash
Update every entry in a Ruby Hash with a concise merge! trick when each key needs a new computed value.
Unicorn: How to force a single threaded boot in development
Limit Unicorn to one worker in development to keep debugging output manageable and prevent concurrent requests like ActionCable from flooding the console.
Connecting to MSSQL with Ruby on Ubuntu - lambie.org
Connecting Ruby on Ubuntu to Microsoft SQL Server can require nonstandard drivers and native libraries, especially for older SQL Server versions on Linux.
Debugging failed AJAX requests with better_errors
better_errors adds enhanced development error pages with a live REPL, and /__better_errors lets you inspect exceptions from AJAX requests.
Why your Cucumber feature loses cookies when run under Selenium
Cucumber/Selenium tests can lose cookies and sessions when the app and browser run in different times, because old dates make cookies expire immediately.
RSpec 2.6 supports "any_instance" now
any_instance stubbing and expectations now work in RSpec 2.6, enabling should_receive and stub on instances created inside code.
How to stub class constants in RSpec
RSpec cannot stub constants directly; using attributes, wrapper methods, or test helpers makes constant-dependent code easier to isolate.