Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def valid_extensions
- @@valids ||= Regexp.new("\." + Extension.find(:all).map(&:name).join('|') + '$')
- end
- =====
- errors.add(:image, "invalid file type") unless image_name =~ valid_extensions
Add Comment
Please, Sign In to add comment