I'm upgrading an application from Rails 3.0 to 3.1 and found the following error showing up in my tests:
NoMethodError: undefined method `delete' for #
I have the following snippet that moves errors :
after_validation do
self.errors[:image_size].each do |message|
self.errors.add(:image, message)
end
self.errors[:image_extension].each do |message|
self.errors.add(:image, message)
end
self.errors.delete(:image_size)
self.errors.delete(:image_extension)
end
I still need to be able to move all validations from image_size and image_extension, but I'm not sure how do this in Rails 3.1. Any ideas?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)