I''ve been poking around using my search-fu to look for a way to run code after Rails 3 has initialised but before any requests are services. I was thinking of scenarios like migrating the database or forcing administrators to set values to new application configuration properties and things like that. I think using Railties would work but I was wondering if there was already something out there (Railtie, plugin) before I tried to re- create the wheel so to speak. Anyone know of anything or implemented something similar? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 20, 4:30 pm, cdempsey <cdal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve been poking around using my search-fu to look for a way to run > code after Rails 3 has initialised but before any requests are > services. I was thinking of scenarios like migrating the database or > forcing administrators to set values to new application configuration > properties and things like that.How about in boot.rb or is that too early ? I wouldn''t recommend using that kind of process for migrations though, you could have bad side effects, for instances if two instances of rails get started up (by accident, crash recovery mechanism, etc.) and both attempt to perform the migration. Katie -- http://www.coderstack.co.uk/ruby-developer-jobs -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
It sounds like you want an admin mode to do some setup before the app goes live. If that''s the case, why not have a special controller for that purpose and some logic to redirect to that controller if the app is in a nascent state? Seems like one of the wizard recipes could also apply nicely here. Martin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.