Skip to content

Commit

Permalink
Prepare for 3.3.0 Release (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeKaraszi authored Jul 22, 2024
1 parent 2e2cfd9 commit 98a8c42
Show file tree
Hide file tree
Showing 24 changed files with 106 additions and 158 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
engines:
rubocop:
enabled: true
channel: rubocop-1-31-0
channel: rubocop-1-56-3
duplication:
enabled: true
config:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ jobs:
strategy:
fail-fast: false
matrix:
rails: [60, 61, 70, 71]
ruby: ['3.0', 3.1, 3.2]
rails: [61, 70, 71, 72]
ruby: [3.1, 3.2, 3.3]
experimental: [false]
# exclude:
# - ruby: 3.0
# rails: 52
include:
- rails: head
ruby: '3.0'
experimental: true
- rails: head
ruby: 3.1
experimental: true
- rails: head
ruby: 3.2
experimental: true
- rails: head
ruby: 3.3
experimental: true

services:
postgres:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require:

AllCops:
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1
DisplayStyleGuide: true
DisplayCopNames: true
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.0
3.3.4
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ source "https://rubygems.org"
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem "bundler", ">= 2.2", "< 3.0"

# Required for Ruby 3.3+ to fix runtime warnings
gem "base64"
gem "bigdecimal"
gem "mutex_m"

gem "database_cleaner", "~> 2.0"
gem "rake", ">= 10.0"
gem "rspec", "~> 3.0"
Expand Down
110 changes: 52 additions & 58 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
PATH
remote: .
specs:
active_record_extended (3.2.1)
active_record_extended (3.3.0)
activerecord (>= 5.2, < 8.0.0)
pg (< 3.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (7.1.1)
activesupport (= 7.1.1)
activerecord (7.1.1)
activemodel (= 7.1.1)
activesupport (= 7.1.1)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
timeout (>= 0.4.0)
activesupport (7.1.1)
activesupport (7.1.3.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand All @@ -25,104 +25,95 @@ GEM
mutex_m
tzinfo (~> 2.0)
ast (2.4.2)
base64 (0.1.1)
bigdecimal (3.1.4)
base64 (0.2.0)
bigdecimal (3.1.8)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.2.2)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
database_cleaner (2.0.2)
database_cleaner-active_record (>= 2, < 3)
database_cleaner-active_record (2.1.0)
database_cleaner-active_record (2.2.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
diff-lcs (1.5.0)
diff-lcs (1.5.1)
docile (1.4.0)
dotenv (2.8.1)
drb (2.1.1)
ruby2_keywords
i18n (1.14.1)
dotenv (3.1.2)
drb (2.2.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.6.3)
json (2.7.2)
language_server-protocol (3.17.0.3)
method_source (1.0.0)
minitest (5.20.0)
mutex_m (0.1.2)
method_source (1.1.0)
minitest (5.24.1)
mutex_m (0.2.0)
niceql (0.6.1)
parallel (1.23.0)
parser (3.2.2.4)
parallel (1.25.1)
parser (3.3.4.0)
ast (~> 2.4.1)
racc
pg (1.5.4)
pg (1.5.6)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
racc (1.7.1)
racc (1.8.0)
rails_sql_prettifier (7.0.4)
activerecord (>= 7)
niceql (~> 0.6)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.2)
rake (13.2.1)
regexp_parser (2.9.2)
rexml (3.3.2)
strscan
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (~> 3.13.0)
rspec-sqlimit (0.0.6)
activerecord (>= 4.2.0, < 8)
rspec (~> 3.0)
rspec-support (3.12.1)
rubocop (1.57.0)
base64 (~> 0.1.1)
rspec-support (3.13.1)
rubocop (1.65.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.24.1)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec (3.0.3)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
strscan (3.1.0)
timeout (0.4.0)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
Expand All @@ -133,10 +124,13 @@ PLATFORMS

DEPENDENCIES
active_record_extended!
base64
bigdecimal
bundler (>= 2.2, < 3.0)
byebug
database_cleaner (~> 2.0)
dotenv
mutex_m
pry
pry-byebug
rails_sql_prettifier
Expand All @@ -150,4 +144,4 @@ DEPENDENCIES
simplecov (~> 0.16)

BUNDLED WITH
2.3.19
2.5.16
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ Active Record Extended is essentially providing users with the other half of Pos
## Compatibility

This package is designed align and work with any officially supported Ruby and Rails versions.
- Minimum Ruby Version: 3.0.x **(EOL warning!)**
- Minimum Rails Version: 6.0.x **(EOL warning!)**
- Minimum Ruby Version: 3.1.x **(EOL warning!)**
- Minimum Rails Version: 6.1.x **(EOL warning!)**
- Minimum Postgres Version: 12.x **(EOL warning!)**
- Latest Ruby supported: 3.2.x
- Latest Ruby supported: 3.3.x
- Latest Rails supported: 7.1.x
- Postgres: 11-current(15) (probably works with most older versions to a certain point)
- Postgres: 11-current(16) (probably works with most older versions to a certain point)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion active_record_extended.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|

spec.files = Dir["README.md", "lib/**/*"]
spec.require_paths = ["lib"]
spec.required_ruby_version = ">= 3.0"
spec.required_ruby_version = ">= 3.1"
spec.metadata["rubygems_mfa_required"] = "true"

spec.add_dependency "activerecord", ">= 5.2", "< 8.0.0"
Expand Down
9 changes: 0 additions & 9 deletions gemfiles/activerecord-60.gemfile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ source "https://rubygems.org"
gemspec path: ".."
eval_gemfile "../Gemfile"

gem "activerecord", "~> 5.2.0"
gem "activerecord", "7.2.0.beta3"
gem "pg", "< 2.0"
4 changes: 0 additions & 4 deletions lib/active_record_extended/arel/nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

module Arel
module Nodes
unless ActiveRecordExtended::AR_VERSION_GTE_6_1
["Contains", "Overlaps"].each { |binary_node_name| const_set(binary_node_name, Class.new(::Arel::Nodes::Binary)) }
end

[
"ContainsHStore",
"ContainsArray",
Expand Down
23 changes: 0 additions & 23 deletions lib/active_record_extended/arel/visitors/postgresql_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,6 @@ module PostgreSQLDecorator
private

# rubocop:disable Naming/MethodName

unless ActiveRecordExtended::AR_VERSION_GTE_6_1
def visit_Arel_Nodes_Overlaps(object, collector)
infix_value object, collector, " && "
end
end

unless ActiveRecordExtended::AR_VERSION_GTE_6_1
def visit_Arel_Nodes_Contains(object, collector)
left_column = object.left.relation.name.classify.constantize.columns.detect do |col|
matchable_column?(col, object)
end

if [:hstore, :jsonb].include?(left_column&.type)
visit_Arel_Nodes_ContainsHStore(object, collector)
elsif left_column.try(:array)
visit_Arel_Nodes_ContainsArray(object, collector)
else
visit_Arel_Nodes_Inet_Contains(object, collector)
end
end
end

def visit_Arel_Nodes_ContainsArray(object, collector)
infix_value object, collector, " @> "
end
Expand Down
2 changes: 1 addition & 1 deletion lib/active_record_extended/patch/array_handler_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def call(attribute, value)
return attribute.eq(value) if column.try(:array)
end

super(attribute, value)
super
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/active_record_extended/query_methods/unionize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ def unionize_storage!
unionized_name: lambda { |klass| klass.arel_table.name }
}.each_pair do |method_name, default|
define_method(method_name) do
return unionize_storage[method_name] if send("#{method_name}?")
return unionize_storage[method_name] if send(:"#{method_name}?")

(default.is_a?(Proc) ? default.call(@klass) : default.new)
end

define_method("#{method_name}?") do
define_method(:"#{method_name}?") do
unionize_storage.key?(method_name) && !unionize_storage[method_name].presence.nil?
end

define_method("#{method_name}=") do |value|
define_method(:"#{method_name}=") do |value|
unionize_storage![method_name] = value
end
end
Expand Down
Loading

0 comments on commit 98a8c42

Please sign in to comment.