rails / solid_cache

A database-backed ActiveSupport::Cache::Store
MIT License
890 stars 63 forks source link

Undefined method error on Rails 7.2 #178

Closed arni1981 closed 4 months ago

arni1981 commented 6 months ago

I'm getting undefined method 'model' for class SolidCache::Entry on Rails 7.2.

I tried it on a brand new Rails project and just did gem "rails", github: "rails/rails", branch: "7-2-stable"

It happens whether I do <%= cache%> in a view or Rails.cache.fetch

MaksJS commented 5 months ago

A possible quick & dirty fix (to be tested):

ActiveSupport.on_load(:solid_cache_entry) do
  class << self
    def model = self
    def scope_for_create = {}
  end
end
npezza93 commented 4 months ago

This is fixed now that #179 is merged

arni1981 commented 4 months ago

Ok, I will close it then, since it is working when pointing to the main branch of solid_cache. it has not been released yet though.