-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The `table_name` method was defined in `Arel::Nodes::Table` and `Arel::Nodes::TableAlias` to get the table name, but `Arel::Nodes::Table#table_name` was removed rails/rails#46864. Therefore, it is no longer possible to simply call `#table_name` to get `table_name`, so a `TableNode.table_name` has been added to get table_name from node.
- Loading branch information
Showing
4 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module MultiTenant | ||
module TableNode | ||
# Return table name | ||
def self.table_name(node) | ||
# NOTE: Arel::Nodes::Table#table_name is removed in Rails 7.1 | ||
if node.is_a?(Arel::Nodes::TableAlias) | ||
node.table_name | ||
else | ||
node.name | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters