#nomethoderror(未定义的方法'拒绝' for 0:integer
我正在使用Ruby 3.0和Rails 7.0.2用于我的应用。当我尝试运行控制台或生成控制器或迁移时,它给了我这个错误:
nomethoderror(未定义的方法“拒绝” 0:整数您的意思是?ect):
if existing_problem_sets.present?
existing_problem_sets.each do |problem_set|
problem_set.update!(
sat_question_id: problem_set.sat_question_id.reject{|x| x==self.id.to_s},
sat_position: problem_set.sat_position.reject{|x| x[:sat_question_id] == self.id.to_s})
end #do
end #if
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
。
拒绝
不存在(即“未定义”)sat_question_id
可能是/必须是整数。recood
方法?基于此snippit-
x == self.id.to_s
- 我要猜测您的意思是要编码这样的内容:没有人的答案会比猜测更好,而无需看到您的数据类(ES)(ES)声明和一些实际实例化对象。导致事故的实际物体。
@mechnicov comment may be the key.
reject
does not exist in the Integer class (it is "undefined")reject
being called? Right there! sosat_question_id
might be/must be an integer.reject
method?Based on this snippit -
x==self.id.to_s
- I am going to GUESS you meant to code something like this:Nobody's answer will be better than a guess without seeing your data class(es) declarations and some actual instantiated objects. The actual object that caused the accident.