Method: Sequel::Inflections.singular
- Defined in:
- lib/sequel/model/inflections.rb
.singular(rule, replacement) ⇒ Object
Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression. The replacement should always be a string that may include references to the matched data from the rule.
Example:
singular(/([^aeiouy]|qu)ies$/i, '\1y')
81 82 83 |
# File 'lib/sequel/model/inflections.rb', line 81 def self.singular(rule, replacement) @singulars.insert(0, [rule, replacement]) end |