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...

ariejan.net

Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...

jeff.dallien.net

When you use heredoc, string interpolation is enabled by default: x = "Universe" <<-MESSAGE Hello #{x} MESSAGE # => "Hello Universe"

makandra dev

Sometimes it seems a favicon does not work because your browser displays an old version or (in case of local...

mysqlperformanceblog.com

When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...

tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...

JavaScript has no built-in functions to compare two objects or arrays for equality of their contained values.

Watch out when saying something like 1.year in Rails. The result is not a Fixnum and can cause unexpected errors...

In Ruby 1.9, instance_eval calls the block the with receiver as the first argument: In Ruby 1.8, receiver.instance_eval...

github.com

MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...

apidock.com

Ruby 1.9 changed the default behavior of Module.const_defined? from what it was in Ruby 1.8 -- this can be especially...

This error can happen in Ruby 1.9. To fix it, add the following line to the top of your .js.erb...

gist.github.com

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...

perl.plover.com

So you have a method returning a regular expression but one case that should not yield a matching Regexp object...

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...

makandra dev
github.com

Stringex is a gem that offers some extensions to Ruby's String class. Ruby 1.9 compatible, and knows its way...

github.com

UnicodeUtils implements Unicode algorithms for case conversion, normalization, text segmentation and more in pure Ruby code.

RVM needs to be updated regularly to know of Ruby versions released since installation (or last update).

In our continued quest to extract proven code snippets from makandropedia into tested and upgradable gems, we have released Edge...

The Edge Rider gem gives your relations a method #traverse_association which returns a new relation by "pivoting" around a...

TLDR: Ruby class variables (@@foo) are dangerous in many ways. You should avoid them at all cost. See bottom of...

When creating an ActiveRecord with .new, .create or create!, you cannot set the ID attribute (note: When using Machinist's...