app/models/archangel/asset.rb in archangel-0.3.0 vs app/models/archangel/asset.rb in archangel-0.4.0
- old
+ new
@@ -32,10 +32,10 @@
self.content_type = asset_object.content_type
self.file_size = asset_object.size
end
def valid_file_name
- return if /^[\w-]+\.[A-Za-z]{2,}$/ =~ file_name
+ return if /^[\w-]+\.[A-Za-z]{2,}$/.match?(file_name)
errors.add(:file_name, Archangel.t(:file_name_invalid))
end
end
end