# Include patch from https://github.com/drapergem/draper/commit/027a2cd4b6e3292a755ed301e86bc75039150992
# This fix was made in draper 0.18.0, but that depends on activesupport ~> 3.2.x,
# and our version of Rails is locked at 3.1.x
require "draper/base"
class Draper::Base
  def localize(object, options = {})
    self.class.helpers.localize(object, options)
  end
  alias_method :l, :localize
end

Patch draper to make it compatible with the `localize` method.
Patch draper to make it compatible with the `localize` method.

The `localize` method takes two arguments, but our version of Draper
only accepts one in it's wrapper method. This is fixed in the latest
versions of Draper, but upgrading requires a lot of changing of
code (see [the upgrade manual][1]).

The fix is actually present in Draper 0.18, which requires less of
an upgrade in terms of our presenters, but insists on having
ActiveSupport `~> 3.2`, and we are presently on Rails 3.1.

The simplest way to make progress is, unfortunately, to just patch
the method.

[1]: https://github.com/drapergem/draper/wiki/Upgrading-to-1.0
