Refactored article_categories.
This commit is contained in:
parent
0b1682af7c
commit
0decbb36e1
12 changed files with 39 additions and 118 deletions
|
|
@ -1,8 +1,7 @@
|
|||
class ArticleCategory < ActiveRecord::Base
|
||||
has_many :articles
|
||||
|
||||
validates_length_of :name, :in => 2..20
|
||||
validates_uniqueness_of :name
|
||||
|
||||
validates :name, :presence => true, :uniqueness => true, :length => { :in => 2..20 }
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue