This is the code that I'm looking at:
def method_missing(id, *args)
return self.find(Regexp.last_match(1), args[0]) if id.id2name =~ /find_by_(.+)/
raise NoMethodError
end
What happens if I have multiple threads calling Regexp.last_match
?
What happens if I have multiple threads calling the object with the method_missing
method?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…