Capistrano 2: Which Capistrano hooks to use for events to happen on both "cap deploy" and "cap deploy:migrations"

Capistrano 2 hooks must target deploy:update_code, deploy:symlink, and deploy:restart to run tasks for both cap deploy and cap deploy:migrations.

Why a Rails flash message is shown twice

Flash messages can appear twice when render is used instead of redirect_to; flash.now is for the current request, flash[] for the next one.

Ignore an error class with Airbrake

Airbrake can suppress selected exceptions by default or through config.ignore, reducing noise from expected failures such as invalid requests and unsupported HTTP methods.

Haml and Sass 3.1 are Released

Sass now comes with user-defined functions, keyword arguments, list manipulation. Haml and Sass are now two separate gems.

HTML5 Presentation

Awesome presentation for the new HTML5 features we will get to play with. This presentation should probably be viewed in Chrome only.

How to translate “business value” of things that are technically important

User Stories should describe what a user wants the system to do. Purely technical tasks should usually be implemented as part of a User Story. But, sometimes there are technical tasks which cannot be directly linked to customer value. Things like “Upgrade to MySQL 6.0″ or “replace magic numbers with enums” need to be done. How can you prioritize these critical chores against User Stories? How can you make the product owner aware of the importance of such tasks (and the business risks of procrastination)?

Rails jQuery UJS: Now Interactive

We can now plug into every facet of the Rails jQuery UJS adapter, binding to custom events, and even customizing internal functions, without hacking or monkey-patching the rails.js file itself.

Saving application objects in your session will come back to haunt you

Storing application objects in sessions can trigger ActionController::SessionRestoreError after class removal or deployment. Keep session data to strings and numbers, or provide stubs for old classes.

How to: Apache logs on a daily basis without logrotate

Daily Apache access log rotation without logrotate uses CustomLog with rotatelogs to create timestamped files and avoid nightly web server restarts.

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.

Use CSS attribute selectors with Capybara

Quoted CSS attribute selectors let Capybara check meta tags reliably; unquoted values can trigger Nokogiri CSS syntax errors.

Collect an array of IDs from any object

Normalize records, scopes, and integers into ID lists with collect_ids, making scope arguments accept single objects, arrays, and numeric scalars.

Fix "undefined method `destroy'" in reset_session

Rails 2.3.11 has a bug where reset_session raises undefined method destroy'; copying an initializer to config/initializers` works around it until a maintenance release.

thoughtbot/capybara-webkit

Capybara driver for browser testing with QtWebKit when JavaScript support is needed.

makandra/consul

Our new scope-based authorization gem for Ruby on Rails has been released. This might one day replace Aegis as our standard authorization solution.

List your current Git remotes

git remote -v lists configured repository endpoints and shows which URLs are used for fetching and pushing.

Convert RDoc markup to HTML

Render a README.rdoc file as HTML with rdoc; the generated output lands in doc/index.html, and doc should stay uncommitted for gem work.

RDoc markup reference

Documentation for the horrible RDoc syntax.

Why preloading associations "randomly" uses joined tables or multiple queries

ActiveRecord :include can switch between separate queries and SQL joins, causing ambiguous ORDER BY clauses and hidden production bugs when associations are preloaded.

jeanmartin/konto_check

Ruby gem to check whether a given bic/account-no-combination can possibly be valid for a German bank. Can also resolve German bank names from a given bic.

Use non-ASCII characters on IRB and Rails consoles with RVM and Mac OS X

Missing readline support prevents non-ASCII input in IRB or Rails consoles on Mac with RVM; reinstalling Ruby with readline enables 8-bit characters.

Cast a string to the type of an ActiveRecord attribute

ActiveRecord columns can convert string input to the underlying attribute type, such as integers and booleans, using column metadata.

Retrieve the SQL query a scope would produce in ActiveRecord

Get the SQL generated by an ActiveRecord scope without executing it; Rails 3 uses to_sql, while Rails 2 needs a backport or construct_finder_sql.

How to perform HTTP basic authentication in RSpec

HTTP Basic Authentication sends a Base64-encoded username and password in the Authorization header; RSpec tests can set credentials for request and controller specs.