Skip to content

Commit 46deebd

Browse files
author
Tom Smyth
authored
Remove options restrictions on has_closure_tree_root
1 parent 5d44d22 commit 46deebd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Diff for: lib/closure_tree/has_closure_tree_root.rb

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ class RootOrderingDisabledError < StandardError; end
55
module HasClosureTreeRoot
66

77
def has_closure_tree_root(assoc_name, options = {})
8-
options.assert_valid_keys(
9-
:class_name,
10-
:foreign_key
11-
)
12-
13-
options[:class_name] ||= assoc_name.to_s.sub(/\Aroot_/, "").classify
8+
options[:class_name] ||= assoc_name.to_s.sub(/\Aroot_/, "").classify
149
options[:foreign_key] ||= self.name.underscore << "_id"
1510

1611
has_one assoc_name, -> { where(parent: nil) }, options

0 commit comments

Comments
 (0)