From dbef2f958af2403a12f64fb228d5a83aee33b6d2 Mon Sep 17 00:00:00 2001 From: fanqiang <316257774@qq.com> Date: Mon, 5 May 2014 08:10:22 +0800 Subject: [PATCH] osp_id validate --- app/models/relative_memo.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/relative_memo.rb b/app/models/relative_memo.rb index eeef0eb9c..6a4706633 100644 --- a/app/models/relative_memo.rb +++ b/app/models/relative_memo.rb @@ -17,6 +17,7 @@ class RelativeMemo < ActiveRecord::Base # validates_length_of :subject, maximum: 50 #validates_length_of :content, maximum: 3072 validate :cannot_reply_to_locked_topic, :on => :create + validates_uniqueness_of :osp_id, :scope => [:subject, :context] acts_as_tree :counter_cache => :replies_count, :order => "#{RelativeMemo.table_name}.created_at ASC" acts_as_attachable