Access the Method object Dead simple: Get the method object and ask for its owner: "foo".method(:upcase) # => #
Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.
Do not pass times to date attributes. Always convert times to dates when your application uses time zones. Background
Ruby 1.8 (supplied by Rails' ActiveSupport) >> BigDecimal.new("0.1").floor.class => BigDecimal Ruby 1.9 (supplied by Ruby 1.9 itself) >> BigDecimal.new("0.1").floor.class...
Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...
Guide how to make fixes in other people's GitHub repositories. It's basically "Open Source Development 101".
TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...
tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...
Watch out when saying something like 1.year in Rails. The result is not a Fixnum and can cause unexpected errors...
MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...
See attached link for a way to extract the conditions of a named scope in Rails 2.3.
Rails 2.3.16+ on Ruby 1.9 causes warnings like this: .../gems/activesupport-2.3.17/lib/active_support/core_ext/string/output_safety.rb:22: warning: regexp match /.../n against to UTF-8 string...
JavaScripts and CSS should be minified for production use. In Rails 3.1+ the asset pipeline will take care of this...
If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...
You either have an old version of Mocha and an edge version of Rails 3.2, or you have a new...
This page lists many query methods and options in ActiveRecord which do not sanitize raw SQL arguments and are not...
Stringex is a gem that offers some extensions to Ruby's String class. Ruby 1.9 compatible, and knows its way...
RVM needs to be updated regularly to know of Ruby versions released since installation (or last update).
If bundle install shows the following message for you ... Error Bundler::HTTPError during request to dependency API ... upgrade to Bundler...
In our continued quest to extract proven code snippets from makandropedia into tested and upgradable gems, we have released Edge...
TLDR: Ruby class variables (@@foo) are dangerous in many ways. You should avoid them at all cost. See bottom of...
Ruby has two different ways to match the start and the end of a text: ^ (Start of line) and $ (End...
January has been a very bad month for Ruby on Rails developers, with two high-severity security bugs permitting remote...
If you have an integer and want to use it to represent an element's position (like "1st" for 1...