Skip to content

Commit

Permalink
rename for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekosulin committed Oct 23, 2023
1 parent 6013188 commit 6486936
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/mongoid/slug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def slug(*fields, &block)

# Set indexes
if slug_index && !embedded?
Mongoid::Slug::IndexBuilder.build_indexes(self, slug_scope_key, slug_by_model_type, options[:localize])
Mongoid::Slug::IndexBuilder.build_indexes(self, slug_scope_keys, slug_by_model_type, options[:localize])
end

self.slug_url_builder = block_given? ? block : default_slug_url_builder
Expand Down Expand Up @@ -119,10 +119,10 @@ def slug_scopes
slug_scope ? Array(slug_scope) : [nil]
end

# Returns the scope key for indexing, considering associations
# Returns the scope keys for indexing, considering associations
#
# @return [ Array<Document>, Document ]
def slug_scope_key
def slug_scope_keys
return nil unless slug_scope

# If slug_scope is an array, we map over its elements to get each individual scope's key.
Expand Down

0 comments on commit 6486936

Please sign in to comment.