Skip to content

Commit

Permalink
hack: fix modifying unmodifiable/loaded relation
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Nov 13, 2024
1 parent 5de5069 commit 625b91c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def show
to: :index?

# FIXME(ezekg) https://github.com/brianhempel/active_record_union/issues/35
last_modified = artifacts.maximum(:"#{artifacts.table_name}.updated_at")
last_modified = artifacts.collect(&:updated_at).max
latest = artifacts.first
metadata = artifacts.reduce(
name: package.key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def show
to: :index?

# FIXME(ezekg) https://github.com/brianhempel/active_record_union/issues/35
last_modified = artifacts.maximum(:"#{artifacts.table_name}.updated_at")
last_modified = artifacts.collect(&:updated_at).max
return unless
stale?(artifacts, last_modified:, cache_control: { max_age: 1.day, private: true })

Expand Down

0 comments on commit 625b91c

Please sign in to comment.