diff --git a/lib/cuprum/collections/basic/collection.rb b/lib/cuprum/collections/basic/collection.rb index 35a5a16..f70d98a 100644 --- a/lib/cuprum/collections/basic/collection.rb +++ b/lib/cuprum/collections/basic/collection.rb @@ -93,8 +93,8 @@ def query protected - def command_options - super.merge( + def comparable_options + @comparable_options ||= super.merge( data:, default_contract: ) diff --git a/lib/cuprum/collections/collection.rb b/lib/cuprum/collections/collection.rb index 5390da6..fd54c95 100644 --- a/lib/cuprum/collections/collection.rb +++ b/lib/cuprum/collections/collection.rb @@ -115,27 +115,20 @@ def with_scope(other_scope) attr_writer :scope def comparable_options - command_options.merge( - name:, - qualified_name:, - scope:, - singular_name: - ) - end - - private - - def command_options - @command_options ||= { - collection_name: name, + @comparable_options ||= { entity_class:, - member_name: singular_name, + name:, primary_key_name:, primary_key_type:, + qualified_name:, + scope:, + singular_name:, **options } end + private + def default_scope Cuprum::Collections::Scopes::AllScope.new end diff --git a/lib/cuprum/collections/rspec/contracts/collection_contracts.rb b/lib/cuprum/collections/rspec/contracts/collection_contracts.rb index 2d8ac92..26e98ed 100644 --- a/lib/cuprum/collections/rspec/contracts/collection_contracts.rb +++ b/lib/cuprum/collections/rspec/contracts/collection_contracts.rb @@ -259,7 +259,7 @@ def tools end describe 'with matching name' do - let(:other_options) { { collection_name: name } } + let(:other_options) { { name: } } it { expect(collection.matches?(**other_options)).to be true } end @@ -293,7 +293,7 @@ def tools describe 'with multiple matching options' do let(:other_options) do { - collection_name: name, + name:, primary_key_name: 'id', qualified_name: name } diff --git a/spec/cuprum/collections/basic/collection_spec.rb b/spec/cuprum/collections/basic/collection_spec.rb index c540490..f68a296 100644 --- a/spec/cuprum/collections/basic/collection_spec.rb +++ b/spec/cuprum/collections/basic/collection_spec.rb @@ -41,7 +41,6 @@ end include_contract 'should be a collection', - command_options: %i[data default_contract], commands_namespace: 'Cuprum::Collections::Basic::Commands', default_entity_class: Hash