Methods

Class/Module Index [+]

Quicksearch

Sequel::Plugins::AssociationAutoreloading

The AssociationAutoreloading plugin makes many_to_one association accessor methods automatically reload the cached object whenever the association's foreign key is modified:

Album.many_to_one :artists
album = Album.first
album.artist_id #=> 1
album.artist # caches associated artist
album.artist_id = 2
album.artist # reloads associated artist

Public Class Methods

apply(model) click to toggle source
# File lib/sequel/plugins/association_autoreloading.rb, line 15
def self.apply(model)
  model.instance_variable_set(:@autoreloading_associations, {})
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.