Skip to content

Instantly share code, notes, and snippets.

@KattyaCuevas
Created September 24, 2014 15:38
Show Gist options
  • Save KattyaCuevas/7d81cdb3644b9a5a5e36 to your computer and use it in GitHub Desktop.
Save KattyaCuevas/7d81cdb3644b9a5a5e36 to your computer and use it in GitHub Desktop.
Inflecciones para lenguaje español en Ruby
ActiveSupport::Inflector.inflections.clear
ActiveSupport::Inflector.inflections do |inflect|
inflect.plural /([rlnd])([A-Z]|_|$)/, '\1es\2'
inflect.plural /([aeiou])([A-Z]|_|$)/, '\1s\2'
inflect.singular /([aeiou])s([A-Z]|_|$)/, '\1\2'
inflect.singular /([rlnd])es([A-Z]|_|$)/, '\1\2'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment