Find Class not found When I call it from Controller

Following generic method just tries to read some files that match a pattern . It uses the Find class which is throwing an error[1]

def loadFiles(dir)     logger.debug ">> dir : #{dir}"     messages =

    Find.find(dir) do |f|       next unless File.file?(f)       name = File.basename(p)       messages << f if File.fnmatch('*.FileStreamStore', name)       logger.debug ">> messages : #{messages.inspect}"     end     messages

You need to require 'find'