mirror of https://github.com/rails/rails
More efficiently reset inspect implementation
Not that `inspect` is anywhere close to be a hostspot, but just to not allow a less defficient pattern. Instead of allocating an UnboundMethod and bind_call it, we can directly replace the method.
This commit is contained in:
parent
329582353c
commit
ad81c30859
|
@ -152,9 +152,7 @@ module ActiveRecord # :nodoc:
|
|||
[self.class, cast_type, normalizer, normalize_nil?].hash
|
||||
end
|
||||
|
||||
def inspect
|
||||
Kernel.instance_method(:inspect).bind_call(self)
|
||||
end
|
||||
define_method(:inspect, Kernel.instance_method(:inspect))
|
||||
|
||||
private
|
||||
def normalize(value)
|
||||
|
|
|
@ -30,9 +30,7 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
|
||||
def inspect
|
||||
Kernel.instance_method(:inspect).bind_call(self)
|
||||
end
|
||||
define_method(:inspect, Kernel.instance_method(:inspect))
|
||||
|
||||
def changed_in_place?(raw_old_value, value)
|
||||
return false if value.nil?
|
||||
|
|
Loading…
Reference in New Issue