Method: ActiveSupport::Inflector#tableize
- Defined in:
- activesupport/lib/active_support/inflector/methods.rb
permalink #tableize(class_name) ⇒ Object
Creates the name of a table like Rails does for models to table names. This method uses the #pluralize method on the last word in the string.
tableize('RawScaledScorer') # => "raw_scaled_scorers"
tableize('ham_and_egg') # => "ham_and_eggs"
tableize('fancyCategory') # => "fancy_categories"
204 205 206 |
# File 'activesupport/lib/active_support/inflector/methods.rb', line 204 def tableize(class_name) pluralize(underscore(class_name)) end |