diff --git a/Gemfile.lock b/Gemfile.lock index 819bb86..e431890 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,80 +1,80 @@ PATH remote: . specs: - filterable-by (0.6.4) + filterable-by (0.6.5) activerecord activesupport GEM remote: http://rubygems.org/ specs: - activemodel (7.0.4.2) - activesupport (= 7.0.4.2) - activerecord (7.0.4.2) - activemodel (= 7.0.4.2) - activesupport (= 7.0.4.2) - activesupport (7.0.4.2) + activemodel (7.0.4.3) + activesupport (= 7.0.4.3) + activerecord (7.0.4.3) + activemodel (= 7.0.4.3) + activesupport (= 7.0.4.3) + activesupport (7.0.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) ast (2.4.2) - concurrent-ruby (1.2.0) + concurrent-ruby (1.2.2) diff-lcs (1.5.0) i18n (1.12.0) concurrent-ruby (~> 1.0) json (2.6.3) mini_portile2 (2.8.1) - minitest (5.17.0) + minitest (5.18.0) parallel (1.22.1) - parser (3.2.0.0) + parser (3.2.1.1) ast (~> 2.4.1) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.6.2) + regexp_parser (2.7.0) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.1) rspec-support (~> 3.12.0) rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.3) + rspec-mocks (3.12.4) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.0) - rubocop (1.44.1) + rubocop (1.48.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.26.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) + rubocop-ast (1.27.0) + parser (>= 3.2.1.0) rubocop-bsm (0.6.1) rubocop (~> 1.0) rubocop-performance rubocop-rake rubocop-rspec - rubocop-capybara (2.17.0) + rubocop-capybara (2.17.1) rubocop (~> 1.41) - rubocop-performance (1.15.2) + rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.18.1) + rubocop-rspec (2.19.0) rubocop (~> 1.33) rubocop-capybara (~> 2.17) - ruby-progressbar (1.11.0) - sqlite3 (1.6.0) + ruby-progressbar (1.13.0) + sqlite3 (1.6.1) mini_portile2 (~> 2.8.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -84,7 +84,6 @@ PLATFORMS ruby DEPENDENCIES - bundler filterable-by! rake rspec diff --git a/Gemfile.rails6.lock b/Gemfile.rails6.lock index e11db47..f74f44d 100644 --- a/Gemfile.rails6.lock +++ b/Gemfile.rails6.lock @@ -1,91 +1,90 @@ PATH remote: . specs: - filterable-by (0.6.4) + filterable-by (0.6.5) activerecord activesupport GEM remote: https://rubygems.org/ specs: - activemodel (6.1.7.2) - activesupport (= 6.1.7.2) - activerecord (6.1.7.2) - activemodel (= 6.1.7.2) - activesupport (= 6.1.7.2) - activesupport (6.1.7.2) + activemodel (6.1.7.3) + activesupport (= 6.1.7.3) + activerecord (6.1.7.3) + activemodel (= 6.1.7.3) + activesupport (= 6.1.7.3) + activesupport (6.1.7.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) ast (2.4.2) - concurrent-ruby (1.2.0) + concurrent-ruby (1.2.2) diff-lcs (1.5.0) i18n (1.12.0) concurrent-ruby (~> 1.0) json (2.6.3) - minitest (5.17.0) + minitest (5.18.0) parallel (1.22.1) - parser (3.2.0.0) + parser (3.2.1.1) ast (~> 2.4.1) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.6.2) + regexp_parser (2.7.0) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) + rspec-core (3.12.1) rspec-support (~> 3.12.0) rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.3) + rspec-mocks (3.12.4) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.0) - rubocop (1.44.1) + rubocop (1.48.1) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.26.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) + rubocop-ast (1.27.0) + parser (>= 3.2.1.0) rubocop-bsm (0.6.1) rubocop (~> 1.0) rubocop-performance rubocop-rake rubocop-rspec - rubocop-capybara (2.17.0) + rubocop-capybara (2.17.1) rubocop (~> 1.41) - rubocop-performance (1.15.2) + rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.18.1) + rubocop-rspec (2.19.0) rubocop (~> 1.33) rubocop-capybara (~> 2.17) - ruby-progressbar (1.11.0) - sqlite3 (1.6.0-x86_64-linux) + ruby-progressbar (1.13.0) + sqlite3 (1.6.1-x86_64-linux) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.4.2) - zeitwerk (2.6.6) + zeitwerk (2.6.7) PLATFORMS x86_64-linux DEPENDENCIES activerecord (~> 6.1) - bundler filterable-by! rake rspec diff --git a/filterable-by.gemspec b/filterable-by.gemspec index 93284a4..0f18c22 100644 --- a/filterable-by.gemspec +++ b/filterable-by.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'filterable-by' - s.version = '0.6.4' + s.version = '0.6.5' s.authors = ['Dimitrij Denissenko'] s.email = ['dimitrij@blacksquaremedia.com'] s.summary = 'Generate white-listed filter scopes from URL parameter values' @@ -15,6 +15,5 @@ Gem::Specification.new do |s| s.add_dependency 'activerecord' s.add_dependency 'activesupport' - s.add_development_dependency 'bundler' s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/spec/active_record/filterable_by_spec.rb b/spec/active_record/filterable_by_spec.rb index 21c7055..09ffab9 100644 --- a/spec/active_record/filterable_by_spec.rb +++ b/spec/active_record/filterable_by_spec.rb @@ -41,10 +41,10 @@ end it 'generates combined scopes' do - expect(Comment.filter_by('author_id' => alice.id, 'post_id' => apost.id).pluck(:title)).to match_array(['AA']) - expect(Comment.filter_by('author_id' => alice.id, 'post_id' => bpost.id).pluck(:title)).to match_array(['AB']) - expect(Comment.filter_by('author_id' => bob.id, 'post_id' => apost.id).pluck(:title)).to match_array(['BA']) - expect(Comment.filter_by('author_id' => bob.id, 'post_id' => bpost.id).pluck(:title)).to match_array(['BB']) + expect(Comment.filter_by('author_id' => alice.id, 'post_id' => apost.id).pluck(:title)).to contain_exactly('AA') + expect(Comment.filter_by('author_id' => alice.id, 'post_id' => bpost.id).pluck(:title)).to contain_exactly('AB') + expect(Comment.filter_by('author_id' => bob.id, 'post_id' => apost.id).pluck(:title)).to contain_exactly('BA') + expect(Comment.filter_by('author_id' => bob.id, 'post_id' => bpost.id).pluck(:title)).to contain_exactly('BB') scope = Comment.filter_by('author_id' => [alice.id, bob.id], 'post_id' => bpost.id) expect(scope.pluck(:title)).to match_array(%w[AB BB]) @@ -55,12 +55,12 @@ expect(Comment.filter_by('author_id_not' => [alice.id, bob.id]).pluck(:title)).to match_array(%w[]) expect(Comment.filter_by('post_id_not' => apost.id).pluck(:title)).to match_array(%w[AB BB]) expect(Comment.filter_by('post_author_id_not' => alice.id).pluck(:title)).to match_array(%w[AB BB]) - expect(Comment.filter_by('author_id' => bob.id, 'post_id_not' => bpost.id).pluck(:title)).to match_array(['BA']) + expect(Comment.filter_by('author_id' => bob.id, 'post_id_not' => bpost.id).pluck(:title)).to contain_exactly('BA') end it 'combines with other scopes' do scope = Comment.where(author_id: alice.id).filter_by('post_id' => apost.id) - expect(scope.pluck(:title)).to match_array(['AA']) + expect(scope.pluck(:title)).to contain_exactly('AA') expect(alice.posts.filter_by('post_id' => apost.id).count).to be(1) expect(alice.posts.filter_by('author_id' => alice.id).count).to be(1) @@ -71,7 +71,7 @@ it 'allows custom options' do scope = Post.filter_by({ 'only' => 'me' }, user_id: alice.id) - expect(scope).to match_array([apost]) + expect(scope).to contain_exactly(apost) scope = Post.filter_by({ 'only' => '??' }, user_id: alice.id) expect(scope.count).to eq(2) @@ -82,7 +82,7 @@ it 'allows custom options from params' do filter = { 'only' => 'me' } - expect(Post.filter_by(filter, user_id: alice.id)).to match_array([apost]) + expect(Post.filter_by(filter, user_id: alice.id)).to contain_exactly(apost) expect(Post.filter_by(filter).count).to eq(0) end