method

execute_callstack_for_multiparameter_attributes

Importance_0
execute_callstack_for_multiparameter_attributes(callstack) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/attribute_assignment.rb, line 49
      def execute_callstack_for_multiparameter_attributes(callstack)
        errors = []
        callstack.each do |name, values_with_empty_parameters|
          begin
            if values_with_empty_parameters.each_value.all?(&:nil?)
              values = nil
            else
              values = values_with_empty_parameters
            end
            send("#{name}=", values)
          rescue => ex
            errors << AttributeAssignmentError.new("error on assignment #{values_with_empty_parameters.values.inspect} to #{name} (#{ex.message})", ex, name)
          end
        end
        unless errors.empty?
          error_descriptions = errors.map(&:message).join(",")
          raise MultiparameterAssignmentErrors.new(errors), "#{errors.size} error(s) on assignment of multiparameter attributes [#{error_descriptions}]"
        end
      end
Register or log in to add new notes.