Skip to content

Commit

Permalink
Make :from override singularization in arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
vihai authored and Empact committed Jun 12, 2010
1 parent 8714620 commit 1b57366
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/roxml/definition.rb
Expand Up @@ -63,8 +63,9 @@ def initialize(sym, opts = {}, &block)
end

@attr_name = accessor.to_s.chomp('?')
@name = (opts[:from] || @attr_name).to_s
@name = @attr_name.to_s
@name = @name.singularize if hash? || array?
@name = opts[:from] || @name
if hash? && (hash.key.name? || hash.value.name?)
@name = '*'
end
Expand Down

0 comments on commit 1b57366

Please sign in to comment.