Skip to content

Commit

Permalink
Fix database access caused by calling primary_key
Browse files Browse the repository at this point in the history
This fixes a regression caused by the change to allow customization of
the primary key. While calling `primary_key` on the model is the proper
way to find it's pk, it caused a schema lookup which should be avoided
in class methods so things like asset precompilation can be run without
a database.

This fixes #54.
  • Loading branch information
felixbuenemann committed Sep 8, 2016
1 parent 7a2d305 commit bcdde25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/acts_as_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module ClassMethods
# a custom column by passing a symbol or string.
def acts_as_tree(options = {})
configuration = {
primary_key: primary_key,
primary_key: "id",
foreign_key: "parent_id",
order: nil,
counter_cache: nil,
Expand Down

0 comments on commit bcdde25

Please sign in to comment.