Skip to content
Open
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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.9
3.0.4
171 changes: 96 additions & 75 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,74 @@ PATH
remote: .
specs:
actionset (0.11.0)
activesupport (>= 4.0.2)
activesupport
railties

GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.5)
actionpack (= 5.2.5)
actioncable (6.1.5)
actionpack (= 6.1.5)
activesupport (= 6.1.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.5)
actionpack (= 5.2.5)
actionview (= 5.2.5)
activejob (= 5.2.5)
actionmailbox (6.1.5)
actionpack (= 6.1.5)
activejob (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
mail (>= 2.7.1)
actionmailer (6.1.5)
actionpack (= 6.1.5)
actionview (= 6.1.5)
activejob (= 6.1.5)
activesupport (= 6.1.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.5)
actionview (= 5.2.5)
activesupport (= 5.2.5)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.5)
actionview (= 6.1.5)
activesupport (= 6.1.5)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.5)
activesupport (= 5.2.5)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.5)
actionpack (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
nokogiri (>= 1.8.5)
actionview (6.1.5)
activesupport (= 6.1.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.5)
activesupport (= 5.2.5)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.5)
activesupport (= 6.1.5)
globalid (>= 0.3.6)
activemodel (5.2.5)
activesupport (= 5.2.5)
activerecord (5.2.5)
activemodel (= 5.2.5)
activesupport (= 5.2.5)
arel (>= 9.0)
activestorage (5.2.5)
actionpack (= 5.2.5)
activerecord (= 5.2.5)
marcel (~> 1.0.0)
activesupport (5.2.5)
activemodel (6.1.5)
activesupport (= 6.1.5)
activerecord (6.1.5)
activemodel (= 6.1.5)
activesupport (= 6.1.5)
activestorage (6.1.5)
actionpack (= 6.1.5)
activejob (= 6.1.5)
activerecord (= 6.1.5)
activesupport (= 6.1.5)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0)
arel (9.0.0)
ast (2.4.2)
builder (3.2.4)
capybara (3.32.2)
Expand All @@ -65,11 +82,11 @@ GEM
xpath (~> 3.2)
codecov (0.5.1)
simplecov (>= 0.15, < 0.22)
combustion (1.3.1)
combustion (1.3.5)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
thor (>= 0.14.6)
concurrent-ruby (1.1.8)
concurrent-ruby (1.1.10)
crass (1.0.6)
database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0)
Expand All @@ -84,56 +101,60 @@ GEM
activesupport (>= 4.2.0)
faker (2.12.0)
i18n (>= 1.6, < 2)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.8.10)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
loofah (2.9.1)
loofah (2.16.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.1)
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.0)
mini_portile2 (2.4.0)
minitest (5.14.4)
nio4r (2.5.7)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.15.0)
nio4r (2.5.8)
nokogiri (1.13.4)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
parallel (1.20.1)
parser (3.0.1.0)
ast (~> 2.4.1)
public_suffix (4.0.6)
racc (1.6.0)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.5)
actioncable (= 5.2.5)
actionmailer (= 5.2.5)
actionpack (= 5.2.5)
actionview (= 5.2.5)
activejob (= 5.2.5)
activemodel (= 5.2.5)
activerecord (= 5.2.5)
activestorage (= 5.2.5)
activesupport (= 5.2.5)
bundler (>= 1.3.0)
railties (= 5.2.5)
rails (6.1.5)
actioncable (= 6.1.5)
actionmailbox (= 6.1.5)
actionmailer (= 6.1.5)
actionpack (= 6.1.5)
actiontext (= 6.1.5)
actionview (= 6.1.5)
activejob (= 6.1.5)
activemodel (= 6.1.5)
activerecord (= 6.1.5)
activestorage (= 6.1.5)
activesupport (= 6.1.5)
bundler (>= 1.15.0)
railties (= 6.1.5)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (5.2.5)
actionpack (= 5.2.5)
activesupport (= 5.2.5)
railties (6.1.5)
actionpack (= 6.1.5)
activesupport (= 6.1.5)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.0.0)
rake (13.0.3)
rake (13.0.6)
ransack (2.4.1)
activerecord (>= 5.2.4)
activesupport (>= 5.2.4)
Expand Down Expand Up @@ -181,26 +202,26 @@ GEM
simplecov
terminal-table
simplecov-html (0.12.3)
sprockets (3.7.2)
sprockets (4.0.3)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
terminal-table (3.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thor (1.1.0)
thread_safe (0.3.6)
tzinfo (1.2.9)
thread_safe (~> 0.1)
thor (1.2.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (1.7.0)
websocket-driver (0.7.3)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.5.4)

PLATFORMS
ruby
Expand All @@ -216,7 +237,7 @@ DEPENDENCIES
database_cleaner
factory_bot
faker
rails (~> 5.2.0)
rails (~> 6.1.0)
rake
ransack
rspec
Expand All @@ -227,4 +248,4 @@ DEPENDENCIES
sqlite3

BUNDLED WITH
2.1.4
2.2.33
4 changes: 2 additions & 2 deletions actionset.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_dependency 'activesupport', '>= 4.0.2'
spec.add_dependency 'activesupport'
spec.add_dependency 'railties'

spec.add_development_dependency 'bundler'
Expand All @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'database_cleaner'
spec.add_development_dependency 'factory_bot'
spec.add_development_dependency 'faker'
spec.add_development_dependency 'rails', '~> 5.2.0'
spec.add_development_dependency 'rails', '~> 6.1.0'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'ransack'
spec.add_development_dependency 'rspec'
Expand Down
8 changes: 4 additions & 4 deletions lib/active_set/filtering/active_record/operators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Operators
end
end
BLANK_TRANSFORMER = proc do |type:, **_ctx|
if type.presence_in %i[date float integer time datetime boolean]
if type.presence_in %i[date float integer time datetime boolean decimal]
[nil]
else
Constants::BLANK_VALUES
Expand All @@ -34,23 +34,23 @@ module Operators
next sql.map { |str| START_MATCHER_TRANSFORMER.call(sql: str, type: type, **ctx) } if sql.respond_to?(:map)

str = MATCHER_TRANSFORMER.call(sql: sql, type: type, **ctx)
next str if ['boolean'].include? type.to_s
next str if ['boolean', 'decimal'].include? type.to_s
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/WordArray: Use %w or %W for an array of words.


str + '%'
end
END_MATCHER_TRANSFORMER = proc do |sql:, type:, **ctx|
next sql.map { |str| END_MATCHER_TRANSFORMER.call(sql: str, type: type, **ctx) } if sql.respond_to?(:map)

str = MATCHER_TRANSFORMER.call(sql: sql, type: type, **ctx)
next str if ['boolean'].include? type.to_s
next str if ['boolean', 'decimal'].include? type.to_s
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/WordArray: Use %w or %W for an array of words.


'%' + str
end
CONTAIN_MATCHER_TRANSFORMER = proc do |sql:, type:, **ctx|
next sql.map { |str| CONTAIN_MATCHER_TRANSFORMER.call(sql: str, type: type, **ctx) } if sql.respond_to?(:map)

str = MATCHER_TRANSFORMER.call(sql: sql, type: type, **ctx)
next str if ['boolean'].include? type.to_s
next str if ['boolean', 'decimal'].include? type.to_s
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/WordArray: Use %w or %W for an array of words.


'%' + str + '%'
end
Expand Down
2 changes: 1 addition & 1 deletion lib/active_set/filtering/active_record/query_value.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def query_attribute_for(value)
type: arel_type
}

operator_hash[:query_attribute_transformer].call(context)
operator_hash[:query_attribute_transformer].call(**context)
end

def to_sql_str(value)
Expand Down