igorkasyanchuk/rails_cached_method

There is an error after upgrade rails to 7.1 with `marshal_dump`

開放

#1 建立於 2024年10月2日

 (1 則留言) (0 個反應) (0 位負責人)Ruby (0 個分叉)github user discovery
help wanted

倉庫指標

星標
 (11 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Looks like the problem in these chunk of code:

old = $VERBOSE.dup
$VERBOSE = nil
Object.methods.each do |e|
  delegate e, to: :@__object__
end
$VERBOSE = old

The error looks like:

Failure/Error: page = Page.cached.find_by(identifier: identifier)
     
ActionView::Template::Error:
 RailsCachedMethod::CacheProxy#marshal_dump returned same class instance
# /.../rails_cached_method/lib/rails_cached_method.rb:47:in `method_missing'
# ./app/models/page.rb:56:in `find_page'
# ./app/models/page.rb:48:in `[]'

So, to conclude - the code works pretty fine for rails 7.0, but after upgrade to 7.1 it shows me previously shown error.

貢獻者指南