Get plural version of Rails model name
activerecord, ruby-on-rails
Solution
A few method calls, but this works:
> PaymentMilestone.name.underscore.pluralize
=> "payment_milestones"
Problem
Let's say I have an ActiveRecord model called `PaymentMilestone`. Is there a good way to get `payment_milestones` out of that? (I know `#table_name` can kind of do that, but my table name is `payment_milestone` (singular), not `payment_milestones`, and I need the plural version.)