Wes Gamble
2006-Apr-17 18:27 UTC
[Rails] Validation schemes for model objects that are not yet saved
All, I have a model object that I do a bunch of stuff to before I want to save it to the database. Actually, to be more specific, I do a lot of validation that is related to one attribute on this model. I would like to do some validation on it but take advantage of something akin to ActiveValidation. I''ve read through this http://www.ruby-forum.com/topic/1689#1210 which referenced this: http://www.realityforge.org/articles/2005/12/02/validations-for-non-activerecord-model-objects and I just wondered if anyone had come up with another scheme for handling validation for "partially constructed" model objects that they would be willing to share. I think I can probably just create another non-database model object to handle this validation (since the validation is fairly involved), it seems fair to promote this stuff to first-class object status :). Thanks, Wes -- Posted via http://www.ruby-forum.com/.
Possibly Parallel Threads
- text_field doesn''t call overridden ActiveRecord getters
- Form validation - keepin correct fields displayed on refresh
- Wrap error_messages_for() call when no instance var present
- Verifying some understanding about manipulating DB data in before/after callbacks in RSpec
- rake migrate VERSION=0 doesn''t appear to execute