def assign_attributes(new_attributes, options={})
      sanitized_new_attributes = sanitize_for_mass_assignment_if_sanitizer new_attributes, options

      sanitized_new_attributes.each do |name, value|
        writer = "#{name}="
        send writer, value if respond_to? writer
      end if sanitized_new_attributes
    end
def assign_attributes(new_attributes, options={})
      sanitized_new_attributes = sanitize_for_mass_assignment_if_sanitizer new_attributes, options

      sanitized_new_attributes.each do |name, value|
        writer = "#{name}="
        send writer, value if respond_to? writer
      end if sanitized_new_attributes
    end
Mass update a model's attributes

 @example Assigning a hash
   person.assign_attributes(:first_name => "Chris", :last_name => "Griego")
   person.first_name #=> "Chris"
   person.last_name #=> "Griego"

 @param [Hash{#to_s => Object}, #each] attributes Attributes used to
   populate the model
 @param [Hash, #[]] options Options that affect mass assignment

 @option options [Symbol] :as (:default) Mass assignment role
 @option options [true, false] :without_protection (false) Bypass mass
   assignment security if true

 @since 0.1.0