Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make public method for schema_cache_ignored_tables? #51878

Merged

Conversation

eileencodes
Copy link
Member

Previously we only provided a method to set the ignored schema cache tables, but there was no way to ask if a table was ignored by the schema cache. Applications may want to implement their own schema cache, or at least run this check. Rather than forcing them to implement an internal method, this adds a way to ask whether a table is ignored by the schema cache code.

Usage:

ActiveRecord.schema_cache_ignored_tables = ["developers"]
ActiveRecord.schema_cache_ignored_tables?("developers")

Previously we only provided a method to set the ignored schema cache
tables, but there was no way to ask if a table was ignored by the schema
cache. Applications may want to implement their own schema cache, or at
least run this check. Rather than forcing them to implement an internal
method, this adds a way to ask whether a table is ignored by the schema
cache code.

Usage:

```ruby
ActiveRecord.schema_cache_ignored_tables = ["developers"]
ActiveRecord.schema_cache_ignored_tables?("developers")
```
@eileencodes eileencodes merged commit 2281edf into rails:main May 21, 2024
3 checks passed
@eileencodes eileencodes deleted the add-public-sc-ignored-tables-check branch May 21, 2024 19:33
# Checks to see if the +table_name+ is ignored by checking
# against the +schema_cache_ignored_tables` option.
#
# table_ignored?(:developers)
Copy link
Contributor

Choose a reason for hiding this comment

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

ignored_table??

Copy link
Contributor

Choose a reason for hiding this comment

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

I am confused; should it not be schema_cache_ignored_table?(:developers)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in bd04126.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants