Skip to content

Commit

Permalink
feat: use new concern syntax (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros authored Jan 19, 2024
1 parent 194de58 commit f9cbff0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/closure_tree/digraphs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def to_digraph_label
_ct.has_name? ? read_attribute(_ct.name_column) : to_s
end

module ClassMethods
class_methods do
# Renders the given scope as a DOT digraph, suitable for rendering by Graphviz
def to_dot_digraph(tree_scope)
id_to_instance = tree_scope.reduce({}) { |h, ea| h[ea.id] = ea; h }
Expand Down
2 changes: 1 addition & 1 deletion lib/closure_tree/finders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def without_self(scope)
scope.without_instance(self)
end

module ClassMethods
class_methods do

def without_instance(instance)
if instance.new_record?
Expand Down
2 changes: 1 addition & 1 deletion lib/closure_tree/hash_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def hash_tree(options = {})
_ct.hash_tree(self_and_descendants, options[:limit_depth])
end

module ClassMethods
class_methods do

# There is no default depth limit. This might be crazy-big, depending
# on your tree shape. Hash huge trees at your own peril!
Expand Down
2 changes: 1 addition & 1 deletion lib/closure_tree/hierarchy_maintenance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def delete_hierarchy_references
end
end

module ClassMethods
class_methods do
# Rebuilds the hierarchy table based on the parent_id column in the database.
# Note that the hierarchy table will be truncated.
def rebuild!
Expand Down
2 changes: 1 addition & 1 deletion lib/closure_tree/numeric_deterministic_ordering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def self_and_descendants_preordered
.reorder(self.class._ct_sum_order_by(self))
end

module ClassMethods
class_methods do

# If node is nil, order the whole tree.
def _ct_sum_order_by(node = nil)
Expand Down

0 comments on commit f9cbff0

Please sign in to comment.