Would validation w/o ActiveRecord have clean sol'n?

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 4/13/06, Benton L. [email protected] 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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs