Skip to content

Commit e3d255e

Browse files
committed
fix: remove useless call get_collection in rename_collection
1 parent 805a673 commit e3d255e

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

packages/forest_admin_datasource_customizer/lib/forest_admin_datasource_customizer/decorators/rename_collection/rename_collection_datasource_decorator.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ def rename_collections(renames)
4747
end
4848

4949
def rename_collection(current_name, new_name)
50-
# Check collection exists
51-
get_collection(current_name)
52-
5350
return unless current_name != new_name
5451

5552
# Check new name is not already used

packages/forest_admin_datasource_customizer/spec/lib/forest_admin_datasource_customizer/decorators/rename_collection/rename_collection_datasource_decorator_spec.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,6 @@ module RenameCollection
111111
)
112112
end
113113

114-
it 'raise an error if the given old name does not exist' do
115-
expect do
116-
@datasource.rename_collection('doesNotExist', 'book')
117-
end.to raise_error(
118-
Exceptions::ForestException,
119-
'Collection doesNotExist not found.'
120-
)
121-
end
122-
123114
it 'change the foreign collection when it is a many to many' do
124115
@datasource.rename_collection('library_book', 'renamed_library_book')
125116
@datasource.rename_collection('book', 'renamed_book')

0 commit comments

Comments
 (0)