Tag Archives: active record

Rails Gotcha: ActiveRecord Caches Associated Records by Default

ActiveRecord will cache the results of association method calls by default, unless you tell it not to. (This applies to Rails 2.3.2 and perhaps earlier versions.) From the documentation: project.milestones # fetches milestones from the database project.milestones.size # uses the … Continue reading

Share
Posted in Rails | Tagged , , , , | 2 Comments