So, this may sound kind of "whacky", but I''m trying to figure
out a way
to populate an ActiveRecord object using YAML instead of a DB table.
I''m not even sure if this is actually feasible, but it sounds like a
good way to increase the performance of a project I''m working on.
For instance, I have a model called CmsModules that contains information
about the sections in a CMS. Modules are only added during development,
so the table will never be updated while in production. The way things
are currently set up, an SQL statement is executed on every page load in
order to grab that information. I figure this is unnecessary, and I''d
like to keep the same functionality without making those extra calls to
the database.
I figure that I could use a YAML file to store the module information,
therefore eliminating the need to access the database. Easy enough to
do using YAML::load, but the problem is that I need to keep a HABTM
relationship to the User model intact for access control. That''s where
I''m lost...
So, my question is this - is there any way to have legit ActiveRecord
objects populated from a YAML file, completely bypassing the database?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---