Permalink
Browse files

Use instance_eval instead of Proc#bind

Proc#bind is not useful when called immediately and previous check for #call method is not correct
  • Loading branch information...
1 parent 5e81021 commit 3fbc042b580f518d060671d0dd86ec2a4d14a42b @lest lest committed Jan 23, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 actionmailer/lib/action_mailer/base.rb
@@ -1,7 +1,6 @@
require 'mail'
require 'action_mailer/collector'
require 'active_support/core_ext/object/blank'
-require 'active_support/core_ext/proc'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/hash/except'
require 'action_mailer/log_subscriber'
@@ -611,7 +610,7 @@ def mail(headers={}, &block)
# Call all the procs (if any)
class_default = self.class.default
default_values = class_default.merge(class_default) do |k,v|
- v.respond_to?(:call) ? v.bind(self).call : v
+ v.respond_to?(:to_proc) ? instance_eval(&v) : v
end
# Handle defaults

0 comments on commit 3fbc042

Please sign in to comment.