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.)
A few method calls, but this works:
> PaymentMilestone.name.underscore.pluralize
=> "payment_milestones"
                        PaymentMilestone.model_name.plural
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With