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.
Select an unknown option with Capybara
Selecting a dropdown value without knowing the available options helps in tests where only a valid choice is needed. Capybara can read an option from the list and select it by text.
dbconsole in Rails 3 requires the environment as the first argument
Rails 3 dbconsole misreads -p test and opens the development database unless the environment is passed first.
Backup your Mac to an encrypted local hard drive
Time Machine local backups can be encrypted by using an encrypted external volume instead of a disk image. Sparsebundle images are not recognized for local drives.
xdissent/ievms - GitHub
Run multiple Internet Explorer versions in separate VirtualBox VMs on Linux or OS X for website testing without Microsoft VirtualPC.
When Balsamiq Mockups won't let you load an image file
Image import can fail in Balsamiq Mockups when a file with the same name already exists in the project folder, blocking the load.
How to accept or deny JavaScript confirmation dialogs in Capybara/Selenium
JavaScript confirmation dialogs in Capybara/Selenium can block tests or auto-dismiss unexpectedly. Direct alert handling restores accept, dismiss, and text access.
ActiveRecord 3+ auto-converts times to UTC by default. Hilarity ensues.
Rails 3 auto-converts ActiveRecord times to UTC by default, which can break code using Time.now or Time.parse; local time and non-aware attributes restore the older behavior.
Rendering a custom 404 page in Rails 2
Custom handling for missing records in Rails 2 can render a branded 404 page instead of a generic exception when ActiveRecord::RecordNotFound occurs.
mojombo/grit - GitHub
Ruby library for object-oriented read and write access to Git repositories.
Let a Rails 3 application make a request to itself
Rails 3 can issue internal HTTP requests through the Rack interface, useful for Cucumber features and testing app responses without a browser.
When Rails no longer renders changes in view templates or Sass stylesheets
Cached pages in development can prevent Rails from rendering updated view templates or Sass stylesheets, especially when stale files remain in public/.
Rails 3.1.0 has been released!
Rails 3.1 adds jQuery by default, streaming responses, role-based attr_accessible, prepared statements, and simpler migrations.
Web Upd8: Ubuntu / Linux blog
Daily Ubuntu, Linux and GNOME news with practical HOWTOs for users who want updates and troubleshooting help.
Ruby: Convert a time string to your local time zone
Parsing a time string with a time zone converts it to local time automatically; Time.parse needs time or tzinfo to be available.
Windows 7: Open terminal from Explorer
Open a cmd prompt directly in the current Explorer folder using a built-in Windows 7 shortcut from the context menu.
Fix: "undefined method `bytesize' for #<Array>"
WEBrick can mask Rails startup failures with undefined method bytesize for #<Array>, hiding the real cause until logs are checked or another server is used.
Use different code for Rails 2 and Rails 3
Reusable Ruby code can need different behavior across Rails 2 and Rails 3+. Version checks let code branch cleanly for compatibility.
Install the DeaDBeeF music player under Ubuntu Linux
DeaDBeeF is a lightweight music player for Linux users who want an alternative to the default playback app. Installation is available for Ubuntu systems.
Always show all form errors during development
Forms can fail validation without visible feedback when the offending field has no input. A development-only error box keeps all form errors visible without leaving debug markup behind.
Let Webrat make a POST request
Webrat can submit a page request as POST by passing :post to visit, useful when a path must be tested with form-style submission.
Webrat doesn't follow redirect because it considers the url external
Absolute URLs in Rails tests can be treated as external because the host is unknown, breaking redirect handling in Webrat. Use path-only matching or reset Webrat to the local site.
Timecop creates records in the past after calling Timecop.freeze
Timecop 0.3.4 and earlier can create records with timestamps in the past after Timecop.freeze; upgrading to 0.3.5 avoids the bug.
Time#utc, Time#gmt and Time#localtime are destructive methods
Time#utc, Time#gmt and Time#localtime mutate the receiver instead of returning a converted copy, which can cause hidden side effects in shared Time objects.