You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: app.rb
    path of file: ./repos/meta_pinger/app/models
    
    the code of the file until where you have to start completion: class App < ActiveRecord::Base
  attr_accessible   :url, :project_name
  validates         :url, :project_name, { :uniqueness => true, :presence => true }

  after_initialize  :format_attributes
  after_save        :alert_admin

  def format_at
    
  def format_attributes
    match = /^(https?:\/\/)?(w{3}\.)?(\S+)(\.herokuapp\.com)\/?$/i.match(self.url)
    if !match
      errors.add(:url_invalid, "ERROR: It seems you supplied an unworthy URL. Make sure the URL ends in 'herokuapp.com'.")
    else
      self.project_name = $3.parameterize
      self.url          = "http://" + $3 + $4
    end