1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Avoid deprecation warnings and potential TypeErrors [#4404 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
Nicolas Sanguinetti 2010-04-15 09:56:45 -03:00 committed by Pratik Naik
parent 68f4e046a7
commit 4bce5ba600
2 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@ module AbstractController
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 @@ module AbstractController
view_assigns.each { |k,v| object.instance_variable_set(k, v) }
end
end
end
end

View file

@ -126,7 +126,7 @@ module AbstractController
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