When I use find(:all) ActiveRecord method, first it asks for attributes names, using MySql query SHOW FIELDS Is there a way to avoid generating that query, and write the names of the attributes manually somewhere? -- 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 -~----------~----~----~----~------~----~------~--~---
Why exactly do you want to do that? If you run Rails in production mode, this query is only executed once for each time the server is started, I believe. In dev mode, it is run for every request. Max On 8/28/06, Dmitry Hazin <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > When I use find(:all) ActiveRecord method, first it asks for attributes > names, using MySql query SHOW FIELDS > Is there a way to avoid generating that query, and write the names of > the attributes manually somewhere? > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Max Muermann wrote:> Why exactly do you want to do that? > > If you run Rails in production mode, this query is only executed once > for each time the server is started, I believe. In dev mode, it is run > for every request. > > MaxOh, if it is only executed on server start that''s great:) Yes, I''m developing my first Rails application in the dev mode so I see this query being executed for every request Tks -- 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 -~----------~----~----~----~------~----~------~--~---