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:
parent
68f4e046a7
commit
4bce5ba600
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue