projects
/
rails.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Expire diary pages which contain comments by a user when necessary
[rails.git]
/
app
/
models
/
relation_tag.rb
diff --git
a/app/models/relation_tag.rb
b/app/models/relation_tag.rb
index 939165ebd30f9cc136a12d77f4b013165bf0be27..812b2ec3592f7f866a28b27b79259839b8658ad6 100644
(file)
--- a/
app/models/relation_tag.rb
+++ b/
app/models/relation_tag.rb
@@
-3,4
+3,8
@@
class RelationTag < ActiveRecord::Base
belongs_to :relation, :foreign_key => 'id'
+ validates_presence_of :id
+ validates_length_of :k, :v, :maximum => 255, :allow_blank => true
+ validates_uniqueness_of :id, :scope => :k
+ validates_numericality_of :id, :only_integer => true
end