This commit is contained in:
Toks
2013-05-20 08:42:15 -04:00
parent 1fe8b59c7a
commit d99e9c5d81
3 changed files with 16 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ class WikiPage < ActiveRecord::Base
before_validation :initialize_creator, :on => :create
before_validation :initialize_updater
after_save :create_version
before_destroy :create_mod_action_for_destroy
belongs_to :creator, :class_name => "User"
belongs_to :updater, :class_name => "User"
validates_uniqueness_of :title, :case_sensitive => false
@@ -159,4 +160,8 @@ class WikiPage < ActiveRecord::Base
end
end.map {|x| x.mb_chars.downcase.tr(" ", "_").to_s}
end
def create_mod_action_for_destroy
ModAction.create(:description => "permanently deleted wiki page [[#{title}]]")
end
end