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!
- ISO C++ forbids comparison between pointer and integer [-fpermissive]
- Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory (How to Fix)
- Comparison of ITK and VTK
- How to Fix “junit.framework.Comparison Failure Expected: but was”
- Mac & IOS development common error code comparison table
- Swift fatal error: unexpectedly found nil while unwrapping an Optional value？
- Method of ignoring case in Python string comparison
- Swift Error fatal error: unexpectedly found nil while unwrapping an Optional value
- Go start error: Panic: runtime error: invalid memory address or nil pointer reference
- After the go pointer is declared and assigned, a panic: runtime error: invalid memory address or nil pointer reference appears
- Solution: unity package failed. Commandinvocationfailure: gradle build failed
- Installation failed with message Failed to finalize session : INSTALL_FAILED_INVALID_APK
- Python import GDAL failed: DLL load failed. The specified module cannot be found.
- NIOS II – Eclipse – ERROR – ” DownLoad elf failed ” – Verify failed between address ….
- Pull the git warehouse code IDEA reports an error: Clone failed: Authentication failed for’http://10.xx.XXXXXXXXXXXXXXXXX’
- Unity 3D – assertion failed: assertion failed on expression: ‘! Getmaineditorwindow()’ error
- Command line access to passive mode FTP server failed, 425 failed to establish connection
- Simulator:861 – Failed to link the design Process “Simulate Behavioral Model” failed
- Mongodb failed to start: child process failed, exited with error number 100