I am a doofus

Noticed by Andrew Stacey
This commit is contained in:
Jacques Distler 2011-10-26 14:21:01 -05:00
parent 987140ed83
commit 57d52b0d15

View file

@ -14,7 +14,7 @@ class WikiFile < ActiveRecord::Base
def validate def validate
if file_name if file_name
if ! is_valid?(file_name) if ! WikiFile.is_valid?(file_name)
errors.add("file_name", "is invalid. Only latin characters, digits, dots, underscores, " + errors.add("file_name", "is invalid. Only latin characters, digits, dots, underscores, " +
"dashes and spaces are accepted") "dashes and spaces are accepted")
elsif file_name == '.' or file_name == '..' elsif file_name == '.' or file_name == '..'