Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Crop < ActiveRecord::Base
- after_find do |crop|
- ActiveSupport::Inflector.inflections.plural(crop.singular, crop.plural) if crop.singular
- end
- ...
- end
- ActiveSupport::Inflector.inflections.plural("beatle", "mopheads")
- p "beatle".pluralize
- => "mopheads"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement