Forum: Ruby on Rails rails activerecord

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joe B. (Guest)
on 2006-02-27 16:40
i found model allway query this sql:

SHOW FIELDS FROM test_table

if my code needn't know table structure, how to remove it?
Justin F. (Guest)
on 2006-03-04 18:53
(Received via mailing list)
Joe B. wrote:
> i found model allway query this sql:
>
> SHOW FIELDS FROM test_table
>
> if my code needn't know table structure, how to remove it?

ActiveRecord makes these queries to enable it to reflect your table
structure in your model.

In development, it keeps making these queries so that if you change the
schema, the application will stay in line. In production it only reads
the structure of each table once after application start.

regards

   Justin
This topic is locked and can not be replied to.