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

Fix ActiveRecord::Relation#cache_key for loaded empty collection #23080

Commits on Jan 16, 2016

  1. Fix ActiveRecord::Relation#cache_key for loaded empty collection

    - Before this patch if we try to find cache_key of a loaded but empty
      collection it used to give error because of trying to call `updated_at`
      on `nil` value generated by
      `collection.max_by(&timestamp_column).public_send(timestamp_column)`.
    - This commit fixes above error by checking if size is greater than zero
      or not.
    prathamesh-sonpatki committed Jan 16, 2016
    Configuration menu
    Copy the full SHA
    8126925 View commit details
    Browse the repository at this point in the history