Skip to content

feat: use new concerns syntax #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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