add patch hint to full_message

this hopefully makes clear which parts were changed by us and which belong to ActiveModel
pull/2550/head
Jan Sandbrink 10 years ago
parent 4f9e93526e
commit afdd089080
  1. 3
      config/initializers/10-patches.rb

@ -76,6 +76,9 @@ module ActiveModel
def full_message(attribute, message)
return message if attribute == :base
# if a model acts_as_customizable it will inject attributes like 'custom_field_1' into itself
# using attr_name_override we resolve names of such attributes.
# The rest of the method should reflect the original method implementation of ActiveModel
attr_name_override = nil
match = /\Acustom_field_(?<id>\d+)\z/.match(attribute)
if match

Loading…
Cancel
Save