For actual read-only data that is an instance of a model class, I'd
set up a class method instead. So for a default location, in
Location.rb,

def self.default_location
  @@default_location ||= Location.find_by_name("San Francisco")
end

This fixes your migration problem, doesn't reload it with every page,
and also works with testing.

On Sun, Feb 22, 2009 at 4:24 PM, Jeff Lewis <jeff.bu...@gmail.com> wrote:
[...]
> If var that you're setting really is global in scope, intended to be
> shared by all users' requests and is read-only, then you could store
> it in a global var:
[...]

--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to