Hello,

I'm creating a model through Model::create, who is expecting a hash (value 
parameter).
One hash value is a frozen string, and I receive an exception that some 
code is trying to modify a frozen string.

Of course, I can dup my parameter and it fixes everything.
But the natural thing is that the create function does not try to modify my 
parameters.


I searched in the gem code and I found that in line 66 of

lib/sequel/plugins/force_encoding.rb
        def typecast_value(column, value)
          s = super
          s.force_encoding(model.forced_encoding) if s.is_a?(String) && 
model.forced_encoding
          s

        end

the code is trying to force an encoding for that value parameter. This 
happens in ruby 1.9 with the introduction of the string encoding handling.


I think a single  s = s.dup    would fix the issue.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/vLPs_0i0_C4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to