Well I was using Rails for a class project, and frankly I love it. However I ran into situation that I want to use have a model object that doesn't get stored into the database, and still have the same validation. The Rails wiki outlines a solution, but it's still kind of a hack (e.g. I can't create a new instance of the non-ActiveRecord model by passing a hash into initialize) I'm wondering if having some kind of base class that allows for validation functionality without hooking up to a DB is under consideration, or better yet, if there's a clean solution for this type of problem already.
on 2006-04-13 10:12
on 2006-04-13 17:25
On 4/13/06, Benton Lam <firstname.lastname@example.org> wrote: > of problem already. > The "Rails Recipes" book has a decent solution for this. Basically, you just need to make sure a few (empty) methods are available in the class you want to validate.