def assign_attributes(new_attributes)
      yield self if block_given?
      unless new_attributes.respond_to?(:stringify_keys)
        raise ArgumentError, "When assigning attributes, you must pass a hash as an argument."
      end
      return nil if new_attributes.blank?
      attributes = new_attributes.stringify_keys
      attributes.each do |k, v|
        _assign_attribute(k, v)
      end
    end
def assign_attributes(new_attributes)
      yield self if block_given?
      unless new_attributes.respond_to?(:stringify_keys)
        raise ArgumentError, "When assigning attributes, you must pass a hash as an argument."
      end
      return nil if new_attributes.blank?
      attributes = new_attributes.stringify_keys
      attributes.each do |k, v|
        _assign_attribute(k, v)
      end
    end
Allows you to set all the attributes by passing in a hash of attributes with
 keys matching the attribute names (which again matches the column names).

   cat = Cat.new(name: "Gorby", status: "yawning")
   cat.attributes # =>  { "name" => "Gorby", "status" => "yawning", "created_at" => nil, "updated_at" => nil}
   cat.assign_attributes(status: "sleeping")
   cat.attributes # =>  { "name" => "Gorby", "status" => "sleeping", "created_at" => nil, "updated_at" => nil }

 Aliased to <tt>attributes=</tt>.