-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Move cache table existence check in method #433
Conversation
It used to require a database connection during assets:precompile, which prevents deployment to Heroku
def caching_tag_list_on?(context) | ||
column_names.include?("cached_#{context.to_s.singularize}_list") | ||
table_exists? && column_names.include?("cached_#{context.to_s.singularize}_list") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this cause extra queries to fire?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's cached :)
# File activerecord/lib/active_record/model_schema.rb, line 202
def table_exists?
connection.schema_cache.table_exists?(table_name)
end
Please address failing tests :) |
So, current behavior is to only include/extend/eval the including class if there's a cached_x_list column. With this patch, the caching methods will always be added. Thoughts? (Hence the failing tests) To retain the current behavior, perhaps those checks could be done in :initialize_acts_as_taggable_on_cache? or some other class method? (Just thinking aloud) |
You know, I'm starting to wonder if this patch is needed at all on master... The problem I had with 2.4 was that But, now that we also call I'll try it out, and close if successful. |
Well, there is issue #432 which is still open |
Also, specifically for Rails 4 apps on heroku, see https://devcenter.heroku.com/articles/labs-user-env-compile#enabling |
… column cache until db connects Specifically see, mbleigh#432 (comment)
Fixed via #438 |
… column cache until db connects Specifically see, mbleigh#432 (comment)
[mbleigh#432][mbleigh#403][mbleigh#433][mbleigh#422] Fix checking for column cache until db connects
It used to require a database connection during assets:precompile, which prevents deployment to Heroku