Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change XML Node Class Checks Use Underscore

Change the xml_node_matches_single_class and
xml_node_matches_many_of_class methods downcase method calls to
underscore. Downcase would change MultiWord classes to "multiword" and
xml_node classes to "multi-word". The underscore method changes both
strings to "multi_word".
  • Loading branch information...
commit 0fb81e8dc50196f221f0c13d92cfaf36191453b5 1 parent 91c4474
@billy-ran-away authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/xml_active.rb
View
6 lib/xml_active.rb
@@ -115,11 +115,11 @@ def one_from_xml(xml, options = [])
end
def xml_node_matches_single_class(xml_node)
- self.name.downcase.eql?(xml_node.name.downcase)
+ self.name.underscore.eql?(xml_node.name.underscore)
end
def xml_node_matches_many_of_class(xml_node)
- self.name.pluralize.downcase.eql?(xml_node.name.downcase)
+ self.name.pluralize.underscore.eql?(xml_node.name.underscore)
end
def xml_node_is_association(xml_node)
@@ -135,4 +135,4 @@ def xml_node_is_association(xml_node)
class ActiveRecord::Base
include XmlActive
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.