This commit is contained in:
albert
2011-06-26 01:52:42 -04:00
parent 739e28919a
commit 4e19d98047
11 changed files with 32 additions and 28 deletions

View File

@@ -4,7 +4,7 @@ class WikiPage < ActiveRecord::Base
after_save :create_version
belongs_to :creator, :class_name => "User"
validates_uniqueness_of :title, :case_sensitive => false
validates_presence_of :body, :title
validates_presence_of :title
validate :validate_locker_is_janitor
attr_accessible :title, :body, :is_locked
scope :titled, lambda {|title| where(["title = ?", title.downcase.tr(" ", "_")])}