module Sequel::Plugins::ForceEncoding::InstanceMethods
Private Instance Methods
Source
# File lib/sequel/plugins/force_encoding.rb 49 def _refresh_set_values(values) 50 super(force_hash_encoding(values)) 51 end
Force the encoding of all string values when setting the instance’s values.
Calls superclass method
Source
# File lib/sequel/plugins/force_encoding.rb 54 def _save_set_values(values) 55 super(force_hash_encoding(values)) 56 end
Force the encoding of all string values when setting the instance’s values.
Calls superclass method
Source
# File lib/sequel/plugins/force_encoding.rb 59 def force_hash_encoding(row) 60 if fe = model.forced_encoding 61 row.each_value{|v| v.force_encoding(fe) if v.is_a?(String) && !v.is_a?(Sequel::SQL::Blob)} 62 end 63 row 64 end
Force the encoding for all string values in the given row hash.
Source
# File lib/sequel/plugins/force_encoding.rb 67 def typecast_value(column, value) 68 s = super 69 if s.is_a?(String) && !s.is_a?(Sequel::SQL::Blob) && (fe = model.forced_encoding) 70 s = s.dup if s.frozen? 71 s.force_encoding(fe) 72 end 73 s 74 end
Force the encoding of all returned strings to the model’s forced_encoding.
Calls superclass method