Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. class Crop < ActiveRecord::Base
  2. after_find do |crop|
  3. ActiveSupport::Inflector.inflections.plural(crop.singular, crop.plural) if crop.singular
  4. end
  5. ...
  6. end
  7.  
  8. ActiveSupport::Inflector.inflections.plural("beatle", "mopheads")
  9.  
  10. p "beatle".pluralize
  11. => "mopheads"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement