From 98a8c42e94d49a1a7cf1357f0a483059a6bde5af Mon Sep 17 00:00:00 2001 From: George Protacio-Karaszi Date: Mon, 22 Jul 2024 11:13:27 -0700 Subject: [PATCH] Prepare for 3.3.0 Release (#107) --- .codeclimate.yml | 2 +- .github/workflows/test.yml | 10 +- .rubocop.yml | 2 +- .ruby-version | 2 +- Gemfile | 6 + Gemfile.lock | 110 +++++++++--------- README.md | 8 +- active_record_extended.gemspec | 2 +- gemfiles/activerecord-60.gemfile | 9 -- ...ord-52.gemfile => activerecord-72.gemfile} | 2 +- lib/active_record_extended/arel/nodes.rb | 4 - .../arel/visitors/postgresql_decorator.rb | 23 ---- .../patch/array_handler_patch.rb | 2 +- .../query_methods/unionize.rb | 6 +- .../query_methods/where_chain.rb | 27 +---- .../query_methods/with_cte.rb | 2 +- lib/active_record_extended/version.rb | 2 +- rubocop/rubocop-naming.yml | 3 + rubocop/rubocop-styles.yml | 4 + spec/query_methods/foster_select_spec.rb | 2 +- spec/query_methods/json_spec.rb | 8 +- spec/query_methods/unionize_spec.rb | 2 +- spec/query_methods/with_cte_spec.rb | 8 +- spec/sql_inspections/with_cte_sql_spec.rb | 18 +-- 24 files changed, 106 insertions(+), 158 deletions(-) delete mode 100644 gemfiles/activerecord-60.gemfile rename gemfiles/{activerecord-52.gemfile => activerecord-72.gemfile} (78%) diff --git a/.codeclimate.yml b/.codeclimate.yml index c3f6c8c..c2c5cef 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,7 +1,7 @@ engines: rubocop: enabled: true - channel: rubocop-1-31-0 + channel: rubocop-1-56-3 duplication: enabled: true config: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eaffb81..7c3e462 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/.rubocop.yml b/.rubocop.yml index 2a94735..ad5896a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 DisplayStyleGuide: true DisplayCopNames: true Exclude: diff --git a/.ruby-version b/.ruby-version index 944880f..a0891f5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.0 +3.3.4 diff --git a/Gemfile b/Gemfile index f3ec468..2ce87fd 100644 --- a/Gemfile +++ b/Gemfile @@ -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" diff --git a/Gemfile.lock b/Gemfile.lock index 9743e83..41167f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -25,96 +25,87 @@ 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) @@ -122,7 +113,7 @@ GEM 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) @@ -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 @@ -150,4 +144,4 @@ DEPENDENCIES simplecov (~> 0.16) BUNDLED WITH - 2.3.19 + 2.5.16 diff --git a/README.md b/README.md index a7b13f7..10836bb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/active_record_extended.gemspec b/active_record_extended.gemspec index 14fceb7..5e245b9 100644 --- a/active_record_extended.gemspec +++ b/active_record_extended.gemspec @@ -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" diff --git a/gemfiles/activerecord-60.gemfile b/gemfiles/activerecord-60.gemfile deleted file mode 100644 index 8eb1aef..0000000 --- a/gemfiles/activerecord-60.gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gemspec path: ".." -eval_gemfile "../Gemfile" - -gem "activerecord", "~> 6.0.0" -gem "pg", "< 2.0" diff --git a/gemfiles/activerecord-52.gemfile b/gemfiles/activerecord-72.gemfile similarity index 78% rename from gemfiles/activerecord-52.gemfile rename to gemfiles/activerecord-72.gemfile index 05dff3e..e3e46cd 100644 --- a/gemfiles/activerecord-52.gemfile +++ b/gemfiles/activerecord-72.gemfile @@ -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" diff --git a/lib/active_record_extended/arel/nodes.rb b/lib/active_record_extended/arel/nodes.rb index 85b56c0..d47ae30 100644 --- a/lib/active_record_extended/arel/nodes.rb +++ b/lib/active_record_extended/arel/nodes.rb @@ -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", diff --git a/lib/active_record_extended/arel/visitors/postgresql_decorator.rb b/lib/active_record_extended/arel/visitors/postgresql_decorator.rb index 746901b..9e2f41d 100644 --- a/lib/active_record_extended/arel/visitors/postgresql_decorator.rb +++ b/lib/active_record_extended/arel/visitors/postgresql_decorator.rb @@ -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 diff --git a/lib/active_record_extended/patch/array_handler_patch.rb b/lib/active_record_extended/patch/array_handler_patch.rb index 0c04d99..9ef728b 100644 --- a/lib/active_record_extended/patch/array_handler_patch.rb +++ b/lib/active_record_extended/patch/array_handler_patch.rb @@ -13,7 +13,7 @@ def call(attribute, value) return attribute.eq(value) if column.try(:array) end - super(attribute, value) + super end end end diff --git a/lib/active_record_extended/query_methods/unionize.rb b/lib/active_record_extended/query_methods/unionize.rb index 2045f62..a59d781 100644 --- a/lib/active_record_extended/query_methods/unionize.rb +++ b/lib/active_record_extended/query_methods/unionize.rb @@ -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 diff --git a/lib/active_record_extended/query_methods/where_chain.rb b/lib/active_record_extended/query_methods/where_chain.rb index ed134aa..f6a6d3f 100644 --- a/lib/active_record_extended/query_methods/where_chain.rb +++ b/lib/active_record_extended/query_methods/where_chain.rb @@ -46,26 +46,7 @@ def all(opts, *rest) # # SELECT tags.* FROM tags INNER JOIN user on user.id = tags.user_id WHERE user.data @> { nickname: 'chainer' } # def contains(opts, *rest) - if ActiveRecordExtended::AR_VERSION_GTE_6_1 - return substitute_comparisons(opts, rest, Arel::Nodes::Contains, "contains") - end - - build_where_chain(opts, rest) do |arel| - case arel - when Arel::Nodes::In, Arel::Nodes::Equality - column = left_column(arel) || column_from_association(arel) - - if [:hstore, :jsonb].include?(column.type) - Arel::Nodes::ContainsHStore.new(arel.left, arel.right) - elsif column.try(:array) - Arel::Nodes::ContainsArray.new(arel.left, arel.right) - else - raise ArgumentError.new("Invalid argument for .where.contains(), got #{arel.class}") - end - else - raise ArgumentError.new("Invalid argument for .where.contains(), got #{arel.class}") - end - end + substitute_comparisons(opts, rest, Arel::Nodes::Contains, "contains") end private @@ -111,11 +92,7 @@ def substitute_comparisons(opts, rest, arel_node_class, method) end def build_where_clause_for(scope, opts, rest) - if ActiveRecordExtended::AR_VERSION_GTE_6_1 - scope.send(:build_where_clause, opts, rest) - else - scope.send(:where_clause_factory).build(opts, rest) - end + scope.send(:build_where_clause, opts, rest) end end end diff --git a/lib/active_record_extended/query_methods/with_cte.rb b/lib/active_record_extended/query_methods/with_cte.rb index da56117..c1c8889 100644 --- a/lib/active_record_extended/query_methods/with_cte.rb +++ b/lib/active_record_extended/query_methods/with_cte.rb @@ -44,7 +44,7 @@ def not_materialized_key?(key) end # @param [Hash, WithCTE] value - def pipe_cte_with!(value) + def pipe_cte_with!(value) # rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity return if value.nil? || value.empty? value.each_pair do |name, expression| diff --git a/lib/active_record_extended/version.rb b/lib/active_record_extended/version.rb index e654f5c..59ba9ef 100644 --- a/lib/active_record_extended/version.rb +++ b/lib/active_record_extended/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ActiveRecordExtended - VERSION = "3.2.1" + VERSION = "3.3.0" end diff --git a/rubocop/rubocop-naming.yml b/rubocop/rubocop-naming.yml index 8348aa7..9a587fa 100644 --- a/rubocop/rubocop-naming.yml +++ b/rubocop/rubocop-naming.yml @@ -21,3 +21,6 @@ Naming/MemoizedInstanceVariableName: Naming/MethodParameterName: Enabled: false + +Naming/BlockForwarding: + Enabled: false diff --git a/rubocop/rubocop-styles.yml b/rubocop/rubocop-styles.yml index 1a531a4..666b361 100644 --- a/rubocop/rubocop-styles.yml +++ b/rubocop/rubocop-styles.yml @@ -144,3 +144,7 @@ Style/FetchEnvVar: Style/YodaCondition: Enabled: false + +Style/HashSyntax: + Enabled: false + diff --git a/spec/query_methods/foster_select_spec.rb b/spec/query_methods/foster_select_spec.rb index 88bbace..87b8019 100644 --- a/spec/query_methods/foster_select_spec.rb +++ b/spec/query_methods/foster_select_spec.rb @@ -48,7 +48,7 @@ Array.new(6) { User.create!(number: enum_numbers.next, ip: "127.0.0.1") } end - it "will return a boolean expression" do + it "returns a boolean expression" do query = User.foster_select( truthly_expr: ["users.number > 0", { cast_with: :bool_and }], falsey_expr: ["users.number > 200", { cast_with: :bool_and }], diff --git a/spec/query_methods/json_spec.rb b/spec/query_methods/json_spec.rb index bbe4bb2..b8472d6 100644 --- a/spec/query_methods/json_spec.rb +++ b/spec/query_methods/json_spec.rb @@ -107,7 +107,7 @@ expect(query.take.cool_dudes["personal"]).to be_a(Array).and(be_empty) end - it "will raise a warning if the value doesn't include a double quoted input" do + it "raises a warning if the value doesn't include a double quoted input" do expect do User.jsonb_build_object( :personal, @@ -126,19 +126,19 @@ shared_examples_for "literal builds" do let(:method) { raise "You are expected to over ride this!" } - it "will accept a hash arguments that will return itself" do + it "accepts a hash arguments that will return itself" do query = User.send(method.to_sym, original_hash) expect(query.take.results).to be_a(Hash).and(be_present) expect(query.take.results).to match(original_hash.stringify_keys) end - it "will accept a standard array of key values" do + it "accepts a standard array of key values" do query = User.send(method.to_sym, hash_as_array_objs) expect(query.take.results).to be_a(Hash).and(be_present) expect(query.take.results).to match(original_hash.stringify_keys) end - it "will accept a splatted array of key-values" do + it "accepts a splatted array of key-values" do query = User.send(method.to_sym, *hash_as_array_objs) expect(query.take.results).to be_a(Hash).and(be_present) expect(query.take.results).to match(original_hash.stringify_keys) diff --git a/spec/query_methods/unionize_spec.rb b/spec/query_methods/unionize_spec.rb index 1740536..33eeaee 100644 --- a/spec/query_methods/unionize_spec.rb +++ b/spec/query_methods/unionize_spec.rb @@ -61,7 +61,7 @@ end context "when merging in query" do - it "will maintain the union table when merging into existing AR queries" do + it "maintains the union table when merging into existing AR queries" do base_query = User.union(User.where(id: user_one.id), User.joins(:profile_l).where.not(id: user_one.id)) other_query = User.merge(base_query) expect(base_query.to_sql).to eq(other_query.to_sql) diff --git a/spec/query_methods/with_cte_spec.rb b/spec/query_methods/with_cte_spec.rb index 7c5e294..3db480f 100644 --- a/spec/query_methods/with_cte_spec.rb +++ b/spec/query_methods/with_cte_spec.rb @@ -50,7 +50,7 @@ VersionControl.create!(versionable: profile_two, source: { help: "no one" }) end - it "will maintain the CTE table when merging into existing AR queries" do + it "maintains the CTE table when merging into existing AR queries" do sub_query = ProfileL.with(version_controls: VersionControl.where.contains(source: { help: "me" })) query = User.joins(profile_l: :version).merge(sub_query) @@ -74,12 +74,12 @@ # Add first CTE to User Relation group_relation = Group.all - user_relation_with_cte = user_relation.with('first_cte' => group_relation) + user_relation_with_cte = user_relation.with("first_cte" => group_relation) # User Relation with a CTE adds itself as another CTE - user_relation_with_self_cte = user_relation_with_cte.with('self_cte' => user_relation_with_cte) + user_relation_with_self_cte = user_relation_with_cte.with("self_cte" => user_relation_with_cte) - expect(user_relation_with_self_cte).to contain_exactly(user_one,user_two) + expect(user_relation_with_self_cte).to contain_exactly(user_one, user_two) end end end diff --git a/spec/sql_inspections/with_cte_sql_spec.rb b/spec/sql_inspections/with_cte_sql_spec.rb index daffab5..c16d63d 100644 --- a/spec/sql_inspections/with_cte_sql_spec.rb +++ b/spec/sql_inspections/with_cte_sql_spec.rb @@ -12,7 +12,7 @@ expect(query).to match_regex(with_personal_query) end - it "will maintain the CTE table when merging" do + it "maintains the CTE table when merging" do query = User.all .merge(User.with(personal_id_one: User.where(personal_id: 1))) .joins("JOIN personal_id_one ON personal_id_one.id = users.id") @@ -21,7 +21,7 @@ expect(query).to match_regex(with_personal_query) end - it "will pipe Children CTE's into the Parent relation" do + it "pipes Children CTE's into the Parent relation" do personal_id_one_query = User.where(personal_id: 1) personal_id_two_query = User.where(personal_id: 2) @@ -84,7 +84,7 @@ expect(query).to match_regex(with_recursive_personal_query) end - it "will maintain the CTE table when merging" do + it "maintains the CTE table when merging" do sub_query = User.with.recursive(personal_id_one: User.where(personal_id: 1)) query = User.merge(sub_query) .joins("JOIN personal_id_one ON personal_id_one.id = users.id") @@ -115,7 +115,7 @@ expect(query).to match_regex(with_materialized_personal_query) end - it "will maintain the CTE table when merging" do + it "maintains the CTE table when merging" do sub_query = User.with .materialized(materialized_personal_id_one: User.where(personal_id: 1)) .with(personal_id_one: User.where(personal_id: 1)) @@ -128,7 +128,7 @@ expect(query).to match_regex(expected_order) end - it "will raise an error if CTE is already not_materialized for that key" do + it "raises an error if CTE is already not_materialized for that key" do materialized_query = User.with.materialized(personal_id_one: User.where(personal_id: 1)) expect do @@ -139,7 +139,7 @@ end.to raise_error(ArgumentError, "CTE already set as materialized") end - it "will pipe Children CTE's into the Parent relation" do + it "pipes Children CTE's into the Parent relation" do personal_id_one_query = User.where(personal_id: 1) personal_id_two_query = User.where(personal_id: 2) @@ -173,7 +173,7 @@ expect(query).to match_regex(with_not_materialized_personal_query) end - it "will maintain the CTE table when merging" do + it "maintains the CTE table when merging" do sub_query = User.with .not_materialized(not_materialized_personal_id_one: User.where(personal_id: 1)) .with(personal_id_one: User.where(personal_id: 1)) @@ -186,7 +186,7 @@ expect(query).to match_regex(expected_order) end - it "will raise an error if CTE is already materialized for that key" do + it "raises an error if CTE is already materialized for that key" do materialized_query = User.with.not_materialized(personal_id_one: User.where(personal_id: 1)) expect do @@ -197,7 +197,7 @@ end.to raise_error(ArgumentError, "CTE already set as not_materialized") end - it "will pipe Children CTE's into the Parent relation" do + it "pipes Children CTE's into the Parent relation" do personal_id_one_query = User.where(personal_id: 1) personal_id_two_query = User.where(personal_id: 2)