# File lib/mongoid/attributes/processing.rb, line 21 def process(attrs = nil, role = :default, guard_protected_attributes = true) attrs ||= {} attrs = sanitize_for_mass_assignment(attrs, role) if guard_protected_attributes attrs.each_pair do |key, value| next if pending_attribute?(key, value) process_attribute(key, value) end yield self if block_given? process_pending end