Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 22nd, 2012  |  syntax: None  |  size: 0.16 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. activerecord - ensure belongs_to points to a valid record when saving
  2. class Model2 < ActiveRecord::Base
  3.   belongs_to :model1
  4.  
  5.   validates_presence_of :model1
  6. end