I am using ruby 3.0 and rails 7.0.2 for my application. when i try to run console or generate controller or migration it gives me this error:
NoMethodError (undefined method `reject' for 0:Integer Did you mean? rect):
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
@mechnicov comment may be the key.
rejectdoes not exist in the Integer class (it is "undefined")rejectbeing called? Right there! sosat_question_idmight be/must be an integer.rejectmethod?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.