0
cat = Hash.new
users = where("last_seen is not null")   
users.each do |u|
  profession = GeneralInformation.where("information_id = ? and information_type = 'User'", u.id).select(:profession)
  if cat.key?(profession) then cat[profession] = cat[profession] + 1 else cat[profession] = 1 end

我调试了这段代码,当解析器试图移动到该行之后

users.each do |u|

我只是被重定向到implicit_render.rb 文件我在rails 控制台中逐步执行了所有这些代码行,它在那里正常工作。什么问题。为什么 .each 方法的行为很奇怪?

4

0 回答 0