Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump deps #17

Merged
merged 2 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 22 additions & 23 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -84,7 +84,6 @@ PLATFORMS
ruby

DEPENDENCIES
bundler
filterable-by!
rake
rspec
Expand Down
47 changes: 23 additions & 24 deletions Gemfile.rails6.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions filterable-by.gemspec
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
16 changes: 8 additions & 8 deletions spec/active_record/filterable_by_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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

Expand Down