-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
cache_key does not consult updated_on #9033
Comments
sounds reasonable. If we support @rafaelfranca what do you think? |
I started a stab at it here: bemurphy@da73700 If we think it's a good idea, I can open a separate PR. I'm not very happy with that code though. It's a) messy and b) seems to know a lot about updated_ column names. |
can you make use of https://github.com/rails/rails/blob/master/activerecord/lib/active_record/timestamp.rb#L89-L91 |
@senny yeah, I was looking at that earlier and thinking it looked useful. I'll take a stab in the morning, thanks. |
ping me here if you need further assistance. I think this is a good change. |
@senny Maybe like bemurphy@e5e0b78. Still messy; I'm feeling hesitant to pollute the methods by extracting to |
Closed by #9105 |
The
Timestamp
module accommodates for bothupdated_at
andupdated_on
timestamps, while.cache_key
only checksupdated_at
.I'm thinking a sane strategy would be to check if either or both exist, and use the max of the result for the cache key. Thoughts?
The text was updated successfully, but these errors were encountered: