Navigation Menu

Skip to content

Commit

Permalink
Avoid deprecation warnings and potential TypeErrors [#4404 state:reso…
Browse files Browse the repository at this point in the history
…lved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
foca authored and lifo committed Apr 15, 2010
1 parent 68f4e04 commit 4bce5ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/abstract_controller/assigns.rb
Expand Up @@ -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
Expand All @@ -18,4 +18,4 @@ def _evaluate_assigns(object)
view_assigns.each { |k,v| object.instance_variable_set(k, v) }
end
end
end
end
2 changes: 1 addition & 1 deletion actionpack/lib/abstract_controller/rendering.rb
Expand Up @@ -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
Expand Down

3 comments on commit 4bce5ba

@carllerche
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@josevalim
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@foca
Copy link
Contributor Author

@foca foca commented on 4bce5ba Apr 17, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.