Skip to content

Instantly share code, notes, and snippets.

@Yax
Created May 24, 2009 15:55
Show Gist options
  • Select an option

  • Save Yax/117165 to your computer and use it in GitHub Desktop.

Select an option

Save Yax/117165 to your computer and use it in GitHub Desktop.
class Ticket < ActiveRecord::Base
# t.integer :category_id
# t.string :employee_name
# t.integer :order_number
# t.string :email
belongs_to :category
has_many :messages
validates_associated :category
validates_presence_of :email, :employee_name
validates_format_of :email,
:with => /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})/
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment