Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #8277 (new enhancement)

Opened 1 year ago

Last modified 7 months ago

[PATCH] Add reload option to the class level of ActiveRecord::Base

Reported by: zdennis Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: reload
Cc:

Description

This patch adds the method ActiveRecord::Base.reload. It does this so more then one ActiveRecord::Base instance can be reloaded.

This is useful to synchronize data if updates got made through plugins like ActiveRecord::Extension's import functionality, or by using custom SQL to insert data via connection.execute.

This has the benefit of using one query at most to reload all of the instances rather then 1 call per instance. It also forwards ActiveRecord::Base#reload to ActiveRecord::Base.reload.

Attachments

add_reload_to_active_record_class_patch.diff (2.5 kB) - added by zdennis on 05/06/07 05:04:00.
patch which adds ActiveRecord::Base.reload

Change History

05/06/07 05:04:00 changed by zdennis

  • attachment add_reload_to_active_record_class_patch.diff added.

patch which adds ActiveRecord::Base.reload

10/23/07 23:37:32 changed by davidomundo

I think we might need to support interoperability with Ticket 9640 (preload / eager load).