Hey people, The module ActiveRecord::ConnectionAdapters::PostgreSQLAdapter lives in the file ''..../connection_adapters/postgresql_adapter.rb''. As such it breaks the module naming convention. I would like to do something like that with a plugin. In my init.rb file I would like to say PostgreSQlAdapter which is in a file named postgresql_adapter.rb. How do I do this? Of course I could change the name a bit to fit the convention but I prefer concise elegance. Thanks. -- 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 -~----------~----~----~----~------~----~------~--~---
On 19 Dec 2008, at 11:33, mo fire wrote:> > Hey people, > > The module ActiveRecord::ConnectionAdapters::PostgreSQLAdapter lives > in > the file ''..../connection_adapters/postgresql_adapter.rb''. As such it > breaks the module naming convention. I would like to do something like > that with a plugin. In my init.rb file I would like to say > PostgreSQlAdapter which is in a file named postgresql_adapter.rb. > How do > I do this? Of course I could change the name a bit to fit the > convention > but I prefer concise elegance. Thanks.You can call things whatever the hell you want and put them where you want. However if you do that you will need to require the files explicitly rather than relying on rails finding and loading the file for you. Fred> > -- > 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 -~----------~----~----~----~------~----~------~--~---
Thanks Fred. I guess I was just wandering whether there was a way to feed the plugin loader a hash mapping or something. In the plugin I''m loading my files first and then doing the relevant module includes. Thanks. Frederick Cheung wrote:> On 19 Dec 2008, at 11:33, mo fire wrote: > >> I do this? Of course I could change the name a bit to fit the >> convention >> but I prefer concise elegance. Thanks. > > You can call things whatever the hell you want and put them where you > want. However if you do that you will need to require the files > explicitly rather than relying on rails finding and loading the file > for you. > > Fred-- 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 -~----------~----~----~----~------~----~------~--~---