Hi railers, Is there a simple method to extend Active Record to have the same functionality as the validate functions e.g. validate_on_find validates_acceptance_of validates_each validates_format_of validates_length_of validates_uniqueness_of but report soft errors maybe to an object warn() instead of errors(). maybe functions like: warn_on_find warn_acceptance_of warn_each warn_format_of warn_length_of warn_uniqueness_of I am aware of save_with_validation(perform_validation = false) but we want to prevent saves if the model is invalid, these are just some softer messages which we would like to retrive on find or save. Any help will be greatly appreciated. regards, Leon
on 2005-11-15 23:59
on 2005-11-16 00:20
One could achieve this my looking at ActiveRecord::Validations::ClassMethods and ActiveRecord::Validations in vendor/rails/activerecord/lib/active_record/validations.rb<http://api.rubyonrails.org/files/vendor/rails/acti... is just does feel like the DRY method.. Any other suggestions?
on 2005-11-17 17:57
rewriting a module like ActiveRecord:Validations does not seem to be the DRY (Don't Repeat Yourself) method. Is there any other method to have warnings on a model?