From 94b4a7afdcda8884d896803ae568dc189885487b Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Tue, 10 Sep 2024 14:26:37 +0900 Subject: [PATCH] activerecord: Arel::Table.new takes table kwargs since v6.1 (#655) refs: * https://github.com/rails/rails/pull/39881 * https://github.com/rails/rails/blob/v6.1.7.8/activerecord/lib/arel/table.rb#L17 --- gems/activerecord/6.0/activerecord-6.0.rbs | 6 ++++++ gems/activerecord/6.0/activerecord-generated.rbs | 2 -- gems/activerecord/6.1/activerecord-6.1.rbs | 6 ++++++ gems/activerecord/7.0/activerecord-7.0.rbs | 8 +++++++- gems/activerecord/7.1/activerecord-7.1.rbs | 12 +++++++++--- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/gems/activerecord/6.0/activerecord-6.0.rbs b/gems/activerecord/6.0/activerecord-6.0.rbs index b4ea946c..7383981a 100644 --- a/gems/activerecord/6.0/activerecord-6.0.rbs +++ b/gems/activerecord/6.0/activerecord-6.0.rbs @@ -52,3 +52,9 @@ module ActiveRecord def initialize: (untyped model, untyped inserts, on_duplicate: untyped, ?unique_by: untyped?, ?returning: untyped?) -> untyped end end + +module Arel + class Table + def initialize: (untyped name, ?type_caster: untyped? type_caster, ?as: untyped? as) -> untyped + end +end diff --git a/gems/activerecord/6.0/activerecord-generated.rbs b/gems/activerecord/6.0/activerecord-generated.rbs index 876f3db5..59921727 100644 --- a/gems/activerecord/6.0/activerecord-generated.rbs +++ b/gems/activerecord/6.0/activerecord-generated.rbs @@ -23508,8 +23508,6 @@ module Arel # TableAlias and Table both have a #table_name which is the name of the underlying table alias table_name name - def initialize: (untyped name, ?type_caster: untyped? type_caster, ?as: untyped? as) -> untyped - def alias: (?::String name) -> Nodes::TableAlias def from: () -> SelectManager diff --git a/gems/activerecord/6.1/activerecord-6.1.rbs b/gems/activerecord/6.1/activerecord-6.1.rbs index abf1bd20..9c15fea7 100644 --- a/gems/activerecord/6.1/activerecord-6.1.rbs +++ b/gems/activerecord/6.1/activerecord-6.1.rbs @@ -60,3 +60,9 @@ module ActiveRecord def initialize: (untyped model, untyped inserts, on_duplicate: untyped, ?unique_by: untyped?, ?returning: untyped?) -> untyped end end + +module Arel + class Table + def initialize: (untyped name, ?type_caster: untyped type_caster, ?as: untyped? as, ?klass: untyped?) -> void + end +end diff --git a/gems/activerecord/7.0/activerecord-7.0.rbs b/gems/activerecord/7.0/activerecord-7.0.rbs index e7d67b77..6d721abc 100644 --- a/gems/activerecord/7.0/activerecord-7.0.rbs +++ b/gems/activerecord/7.0/activerecord-7.0.rbs @@ -89,7 +89,7 @@ module ActiveRecord @record_timestamps: bool def initialize: (untyped model, untyped inserts, on_duplicate: untyped, ?unique_by: untyped?, ?returning: untyped?, ?record_timestamps: bool?) -> untyped - + def record_timestamps?: () -> bool def keys_including_timestamps: () -> Set[String] @@ -97,3 +97,9 @@ module ActiveRecord def timestamps_for_create: () -> Hash[String, String] end end + +module Arel + class Table + def initialize: (untyped name, ?type_caster: untyped type_caster, ?as: untyped? as, ?klass: untyped?) -> void + end +end diff --git a/gems/activerecord/7.1/activerecord-7.1.rbs b/gems/activerecord/7.1/activerecord-7.1.rbs index ca09f305..b0f47e83 100644 --- a/gems/activerecord/7.1/activerecord-7.1.rbs +++ b/gems/activerecord/7.1/activerecord-7.1.rbs @@ -83,8 +83,8 @@ module ActiveRecord class MismatchedForeignKey < StatementInvalid def initialize: (?message: untyped?, ?sql: untyped?, ?binds: untyped?, ?table: untyped?, - ?foreign_key: untyped?, ?target_table: untyped?, ?primary_key: untyped?, - ?primary_key_column: untyped?, ?query_parser: untyped?, + ?foreign_key: untyped?, ?target_table: untyped?, ?primary_key: untyped?, + ?primary_key_column: untyped?, ?query_parser: untyped?, ?connection_pool: ConnectionAdapters::ConnectionPool?) -> void end @@ -110,7 +110,7 @@ module ActiveRecord @record_timestamps: bool def initialize: (untyped model, untyped inserts, on_duplicate: untyped, ?unique_by: untyped?, ?returning: untyped?, ?record_timestamps: bool?) -> untyped - + def record_timestamps?: () -> bool def keys_including_timestamps: () -> Set[String] @@ -118,3 +118,9 @@ module ActiveRecord def timestamps_for_create: () -> Hash[String, String] end end + +module Arel + class Table + def initialize: (untyped name, ?type_caster: untyped type_caster, ?as: untyped? as, ?klass: untyped?) -> void + end +end