lib/decontaminate/decontaminator.rb in decontaminate-0.2.1 vs lib/decontaminate/decontaminator.rb in decontaminate-0.2.2
- old
+ new
@@ -94,10 +94,10 @@
fail "Decoder already registered for key #{key}" if decoders.key? key
decoders[key] = decoder
end
def infer_key(xpath)
- xpath.delete('@').underscore
+ xpath.delete('@').gsub(/^_+|_+$/, '').underscore
end
def infer_plural_path(xpath)
xpath + '/' + xpath.split('/').last.singularize
end