Sha256: de6aad70aa988312595e400cd11d6e674fe72ac84355334509449dbbf0a3094b

Contents?: true

Size: 472 Bytes

Versions: 1

Compression:

Stored size: 472 Bytes

Contents

require 'spec_helper'

module EdgeRider
  module PreloadAssociations

    def preload_associations(*args)
      ActiveRecord::Associations::Preloader.new(*args).run
    end

    if ActiveRecord::Base.respond_to?(:preload_associations, true) # Rails 2.3, Rails 3.0
      ActiveRecord::Base.class_eval do
        class << self
          public :preload_associations
        end
      end
    else # Rails 3.2+
      ActiveRecord::Base.send(:extend, self)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
edge_rider-0.2.0 lib/edge_rider/preload_associations.rb