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

TypeError: no _dump_data is defined for class Liquid::C::ResourceLimits #176

Open
JulienItard opened this issue May 12, 2022 · 2 comments
Open

Comments

@JulienItard
Copy link

Hello there,

when I try to update to latest 4.1 i have this on my specs

     TypeError:
       no _dump_data is defined for class Liquid::C::ResourceLimits

error come from this :

Rails.cache.fetch("render_template/liquid_template/website/#{template_version}/#{name}".freeze, compress: true) do
      Liquid::Template.new.parse(body)
    end

my current version is 4.0. liquid 5.3, ruby 2.7.5, rails 5.2.7

Any idea ? Thanks !

@okzea
Copy link

okzea commented Mar 25, 2023

@JulienItard To fix this error, you can define a _dump_data method for the Liquid::C::ResourceLimits class. The _dump_data method should return a string representation of the object that can be used to reconstruct the object later. Here is an example implementation:

class Liquid::C::ResourceLimits
  def _dump_data
    # return a string representation of the object
    # for example:
    "#{@limit_name}:#{@limit_value}"
  end
end

You might want to do the same with class Liquid::C::BlockBody

@dylanahsmith
Copy link
Contributor

We never intended to support a marshal dump of the liquid-c compiled code. There were some PRs to add proper serialization and deserialization support for a use case like this, but they haven't been merged yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants