Forum: Ruby on Rails Not working validation

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Torsten R. (Guest)
on 2006-05-31 01:31
(Received via mailing list)
Hi there,
I have some model classes where I've tested successful that validation
worked. After some more days of iterations I found that that validation
isn't working anymore. The validation functions are not even called.

class Company < ActiveRecord::Base
	validates_uniqueness_of :name
	validates_numericality_of :money

	validates_each :money do  |record, attr, value|
		record.errors.add( attr, "darf nicht unter 0 sinken.") \
                if value < 0.0

         # more code

That's not the only class for which the validation isn't working
anymore. I've tested the validation by calling save! on an invalid
object and expected that an exception will be thrown. What might cause
the disabling of the validations? Any hints, pointer?

Many thanks in advance and best regards
Torsten R. (Guest)
on 2006-06-01 19:29
(Received via mailing list)
I removed all files with an .rb~ extension. I thought they where from my
editor (jEdit), but after I removed them the validations are performed
again. Hm, wired.

best regards,
This topic is locked and can not be replied to.