Skip to content

Commit

Permalink
fix issues with legacy class names interfering with new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpetro committed Sep 2, 2024
1 parent 4830b56 commit f19d785
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions smart-collections/adapters/multi_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SmartCollectionItemDataAdapter } from './_adapter.js';
// DO: replace this better way in future
const class_to_collection_name = {
'SmartSource': 'smart_sources',
'SmartNote': 'smart_sources', // DEPRECATED: added for backward compatibility
'SmartBlock': 'smart_blocks',
'SmartDirectory': 'smart_directories',
};
Expand Down
2 changes: 1 addition & 1 deletion smart-collections/collection_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class CollectionItem {
* Retrieves the collection name for the instance, either from data or the class method.
* @returns {string} The collection name.
*/
get collection_name() { return this.data.collection_name ? this.data.collection_name : collection_instance_name_from(this.data.class_name || this.constructor.name); }
get collection_name() { return collection_instance_name_from(this.constructor.name); }

/**
* Retrieves the collection this item belongs to.
Expand Down

0 comments on commit f19d785

Please sign in to comment.