def assign_attributes(new_attributes = nil)
      return unless new_attributes.present?
      new_attributes.each do |name, value|
        writer = :"#{name}="
        if respond_to?(writer)
          send(writer, value)
        else
          add_undeclared_property(name, value)
        end
      end
    end
def assign_attributes(new_attributes = nil)
      return unless new_attributes.present?
      new_attributes.each do |name, value|
        writer = :"#{name}="
        if respond_to?(writer)
          send(writer, value)
        else
          add_undeclared_property(name, value)
        end
      end
    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