comparison of Fixnum with nil failed

  def validate
    errors.add(:score, '您的积分不够') if (!self.cur_ask_score.nil?) && (self.score > self.cur_ask_score)
  end

, that’s the validation in the model.

, I started with

  def validate
    errors.add(:score, '您的积分不够') if self.score > self.cur_ask_score
  end

results in the following error:

comparison of Fixnum with nil failed

just now, I ran into a weird problem — the usual assumption is that saving a successful operation doesn’t work!

this kind of problem, generally is the model validation failure caused by!

Read More: