User string.new to inspect String

This commit is contained in:
Gui Vieira 2019-12-29 20:43:39 -08:00
parent ef4284cb16
commit a959060498
2 changed files with 4 additions and 2 deletions

View File

@ -82,7 +82,7 @@ module Shoulda
end
def set
object.public_send("#{attribute_name}=".to_sym, value_written)
object.public_send("#{attribute_name}=", value_written)
after_set_callback.call
@result_of_checking = successful_check
@ -135,7 +135,7 @@ module Shoulda
end
def value_read
@_value_read ||= object.public_send(attribute_name.to_sym)
@_value_read ||= String.new(object.public_send(attribute_name))
end
def attribute_changed_value?

View File

@ -48,6 +48,8 @@ module Shoulda
inspect_hash(value)
when Range
inspect_range(value)
when String
String.new(value)
else
"#{value.inspect}"
end