HighDots Forums  

Where to keep static arrays of data

Ruby On Rails Talk Ruby On Rails programming language mailing list


Discuss Where to keep static arrays of data in the Ruby On Rails Talk forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Foon
 
Posts: n/a

Default Re: Where to keep static arrays of data - 11-10-2009 , 05:03 PM






Hi,

Just a question regarding the following code

Quote:
class SomeModel < AR::Base
FOO_LOOKUP = YAML::load_file(File.join(RAILS_ROOT, 'config',
'foo_lookup.yml'))
end
Why should the model inherit from ActiveRecord::Base ?
Would the array be loaded only once if such a class was in the lib
(without AR inheritance) instead of app/models (which may require the
inheritance) ?

Thanks for your help
I'm quite interested in keeping static arrays like that in memory but
having YAML files constantly being read and structures filled would
ruin all targeted performance gain.
--~--~---------~--~----~------------~-------~--~----~
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 (AT) googlegroups (DOT) com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe (AT) googlegroups (DOT) com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.