method
convert_value
rails latest stable - Class:
Rails::Application::NonSymbolAccessDeprecatedHash
convert_value(value, options = {})public
No documentation available.
# File railties/lib/rails/application.rb, line 642
def convert_value(value, options = {}) # :doc:
if value.is_a? Hash
if options[:for] == :to_hash
value.to_hash
else
self.class.new(value)
end
elsif value.is_a?(Array)
if options[:for] != :assignment || value.frozen?
value = value.dup
end
value.map! { |e| convert_value(e, options) }
else
value
end
end