Forum: Ruby on Rails Would validation w/o ActiveRecord have clean sol'n?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
922fd0a58b1783d3f5f6f8fbecd3ad28?d=identicon&s=25 Benton L. (calyth)
on 2006-04-13 10:12
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
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.
Wilson Bilkovich (Guest)
on 2006-04-13 17:25
(Received via mailing list)
On 4/13/06, Benton Lam <> 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 topic is locked and can not be replied to.