I need find a way to load all the models and their dependencies, but no controllers, views, etc into a program that''s not Rails. Any hints on a good way to do this would be appreciated. So far, I''ve looked at the ActiveSupport additions to Module, and had a look around how script/server starts up. thanks John --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> I need find a way to load all the models and their dependencies, but > no controllers, views, etc into a program that''s not Rails. Any hints > on a good way to do this would be appreciated. > > So far, I''ve looked at the ActiveSupport additions to Module, and had > a look around how script/server starts up.This is more a question for the users list than this one. However you can simply require the relevant files and call establish_connection yourself. Everything should work. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Aug 8, 11:25 am, "Michael Koziarski" <mich...@koziarski.com> wrote:> > I need find a way to load all the models and their dependencies, but > > no controllers, views, etc into a program that''s not Rails. Any hints > > on a good way to do this would be appreciated. > > > So far, I''ve looked at the ActiveSupport additions to Module, and had > > a look around how script/server starts up. > > This is more a question for the users list than this one.Yeah, my post isn''t exactly about Rails development, but I felt it was more likely that someone here would have a good answer.> However you > can simply require the relevant files and call establish_connection > yourself. Everything should work.I tried that, but I run into problems with dependencies, in the sense that certain models depend on others, and some models need acts_as_xxx plugins and access to files that live in the lib/ subdirectory. Obviously Rails deals with those issues, and I was hoping to make use of whatever Rails does rather than rediscovering the techniques and writing code that''s already been written. bye John --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, Aug 8, 2008 at 12:03 PM, John Anderson <panic@semiosix.com> wrote:> > On Aug 8, 11:25 am, "Michael Koziarski" <mich...@koziarski.com> wrote: >> > I need find a way to load all the models and their dependencies, but >> > no controllers, views, etc into a program that''s not Rails. Any hints >> > on a good way to do this would be appreciated. >> >> > So far, I''ve looked at the ActiveSupport additions to Module, and had >> > a look around how script/server starts up. >> >> This is more a question for the users list than this one. > > Yeah, my post isn''t exactly about Rails development, but I felt it was > more likely that someone here would have a good answer. > >> However you >> can simply require the relevant files and call establish_connection >> yourself. Everything should work. > > I tried that, but I run into problems with dependencies, in the sense > that certain models depend on others, and some models need acts_as_xxx > plugins and access to files that live in the lib/ subdirectory. > Obviously Rails deals with those issues, and I was hoping to make use > of whatever Rails does rather than rediscovering the techniques and > writing code that''s already been written.The interplay of all these bits and pieces is handled by the railties initializer. So you could probably sit down and figure out what''s going on and extract your own subset of it. -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On Aug 8, 12:12 pm, "Michael Koziarski" <mich...@koziarski.com> wrote:> The interplay of all these bits and pieces is handled by the railties > initializer. So you could probably sit down and figure out what''s > going on and extract your own subset of it.That''s what I needed to know. Thanks. bye John --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---