Skip to content

Commit

Permalink
Require ActiveRecord in DescendantLoader
Browse files Browse the repository at this point in the history
By requiring ActiveRecord in the DescendantLoader, it allows the .setup
method to be run by just requiring lib/extensions/descendant_loader.rb.

Without it, a "uninitialized constant DescendantLoader::ActiveRecord"
error is raised.
  • Loading branch information
NickLaMuro committed Jun 28, 2017
1 parent 2ff8f43 commit 84cb87e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/extensions/descendant_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
# When Active Record calls `Bbb.descendants` to construct the `type`
# condition, `Ccc` is automatically loaded.
#

require "active_record"

class DescendantLoader
CACHE_VERSION = 2

Expand Down

0 comments on commit 84cb87e

Please sign in to comment.