rails/rails — pull request #12964 by tomasv (2013-11-20 09:46:19+00:00)
Title: Add presence query methods for associations.

Allows associations be queried for presence just like attributes:

class User < ActiveRecord::Base
has_many :tools
end

user = User.first
user.name? # => true, regular attribute query method
user.tools? # => true, checks whether user has any tools

These are equivalent:
user.tools?
user.tools.present?

Motivation:
When extracting model attributes into models I have to change all `foo?` calls into `foo.present?`.
With this change it's more uniform and less painful.