Skip to content

Instantly share code, notes, and snippets.

@binnyg
Created October 26, 2012 13:10
Show Gist options
  • Save binnyg/3958717 to your computer and use it in GitHub Desktop.
Save binnyg/3958717 to your computer and use it in GitHub Desktop.
class Domain < ActiveRecord::Base
belongs_to :user
attr_accessible :name
# Validation
validates :name, :presence => true
validates :name, :uniqueness => { :scope => self.user.id,
:message => "Domain already added to your account" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment