Class Index [+]

Quicksearch

Sequel::Plugins::TacticalEagerLoading::InstanceMethods

Attributes

retrieved_by[RW]

The dataset that retrieved this object, set if the object was reteived via Dataset#all.

retrieved_with[RW]

All model objects retrieved with this object, set if the object was reteived via Dataset#all.

Private Instance Methods

load_associated_objects(opts, reload=false) click to toggle source

If there the association is not in the associations cache and the object was reteived via Dataset#all, eagerly load the association for all model objects retrieved with the current object.

    # File lib/sequel/plugins/tactical_eager_loading.rb, line 43
43:         def load_associated_objects(opts, reload=false)
44:           name = opts[:name]
45:           if !associations.include?(name) && retrieved_by
46:             begin
47:               retrieved_by.send(:eager_load, retrieved_with, name=>{})
48:             rescue Sequel::UndefinedAssociation
49:               # This can happen if class table inheritance is used and the association
50:               # is only defined in a subclass.  This particular instance can use the
51:               # association, but it can't be eagerly loaded as the parent class doesn't
52:               # have access to the association, and that's the class doing the eager loading.
53:               nil
54:             end
55:           end
56:           super
57:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.