Skip to content

Instantly share code, notes, and snippets.

@mayra-cabrera
Created January 22, 2016 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayra-cabrera/adbb773c4ffad3bfc4f4 to your computer and use it in GitHub Desktop.
Save mayra-cabrera/adbb773c4ffad3bfc4f4 to your computer and use it in GitHub Desktop.
ruby_model_example
class Project < ActiveRecord::Base
  belongs_to :portfolio
  has_one :project_manager
  has_many :milestones
  has_many :deliverables, through: milestones
  validates :name, :description, presence: true
  validates :non_disclosure_agreement, acceptance: true
  validates :short_name, uniqueness: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment