Forum: Ruby on Rails Not working validation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C17493831d719174c912567e8778f3dc?d=identicon&s=25 Torsten Robitzki (Guest)
on 2006-05-30 23: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.
Example:

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
	end

         # 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
B263ed6ba137a0cd968d35d1476a9a3c?d=identicon&s=25 Torsten Robitzki (Guest)
on 2006-06-01 17: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,
Torsten
This topic is locked and can not be replied to.