Permalink
Browse files

Avoid deprecation warnings and potential TypeErrors [#4404 state:reso…

…lved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information...
1 parent 68f4e04 commit 4bce5ba600596b5e7afec9b097866ac259c5940a @foca foca committed with lifo Apr 15, 2010
@@ -6,7 +6,7 @@ module Assigns
def view_assigns
hash = {}
variables = instance_variable_names
- variables -= protected_instance_variables if respond_to?(:protected_instance_variables)
+ variables -= config.protected_instance_variables if config.respond_to?(:protected_instance_variables)
variables.each { |name| hash[name] = instance_variable_get(name) }
hash
end
@@ -18,4 +18,4 @@ def _evaluate_assigns(object)
view_assigns.each { |k,v| object.instance_variable_set(k, v) }
end
end
-end
+end
@@ -126,7 +126,7 @@ def _prefix
def view_assigns
hash = {}
variables = instance_variable_names
- variables -= protected_instance_variables if respond_to?(:protected_instance_variables)
+ variables -= config.protected_instance_variables if config.respond_to?(:protected_instance_variables)
variables.each { |name| hash[name.to_s[1..-1]] = instance_variable_get(name) }
hash
end

3 comments on commit 4bce5ba

Contributor

carllerche replied Apr 16, 2010

This commit breaks a test in actionmailer. I believe that Santiago is investigating.

Contributor

josevalim replied Apr 17, 2010

There is no config in ActionMailer, just AM::Base.protected_instance_variables. Revert this commit, use delegates and we will be golden.

Contributor

foca replied Apr 17, 2010

Wouldn't standardizing the APIs and adding config to AM be best?

Please sign in to comment.