method

convert_value

rails latest stable - Class: Rails::Application::NonSymbolAccessDeprecatedHash

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.0.0) is shown here.

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