ActiveRecord without database

The question is this.
Can I use ActiveRecord without the presence of a database?
I use only YAML file for my project and I would like use the power of
ActiveRecord for my models. I have not tested and so I ask you if this
is possible.

Thanks so much.
–Reis

http://wiki.rubyonrails.org/rails/pages/HowToUseValidationsWithoutExtendingActiveRecord
http://www.realityforge.org/articles/2005/12/02/validations-for-non-activerecord-model-objects

On 1/30/06, Andrea R. [email protected] wrote:

The question is this.
Can I use ActiveRecord without the presence of a database?
I use only YAML file for my project and I would like use the power of
ActiveRecord for my models. I have not tested and so I ask you if this
is possible.


kind_regards = {
:name => “Arie”,
:Y! => “riyari3”,
:email => “[email protected]
}

Arie Kusuma A. wrote:

http://wiki.rubyonrails.org/rails/pages/HowToUseValidationsWithoutExtendingActiveRecord
http://www.realityforge.org/articles/2005/12/02/validations-for-non-activerecord-model-objects

Thanks soo much for the link.
–Reis

On Jan 30, 2006, at 1:08 AM, Andrea R. wrote:

The question is this.
Can I use ActiveRecord without the presence of a database?
I use only YAML file for my project and I would like use the power of
ActiveRecord for my models. I have not tested and so I ask you if this
is possible.

Thanks so much.
–Reis

You can easily use rails without using ActiveRecord for the models.
If you just want to use yaml as your models then you are already
there you can eaily just load yaml into hashes or arrays and use them
in the views or wherever. But If you want database type relationships
you will need to use AR or maybe you want to look at kirbybase, a
pure ruby database that is nice and powerfull and uses ruby blocks as
its query language. Kirbybase stores its database in a plain text
file but has indexes so its still very fast.

But alas, the power of rails is closely tied to ActiveRecord and I

think that you will be swimming upstream without it once things get
complicated. Can you elaborate on what you want to do that doesn’t
need a database but needs to store in yaml files?

Cheers

-Ezra Z.
Yakima Herald-Republic
WebMaster

509-577-7732
[email protected]