Skip to content

Instantly share code, notes, and snippets.

@danielsousaio
Last active November 7, 2017 22:19
Show Gist options
  • Save danielsousaio/751ca3c9372ed215195b00c0c950caca to your computer and use it in GitHub Desktop.
Save danielsousaio/751ca3c9372ed215195b00c0c950caca to your computer and use it in GitHub Desktop.
PORO with ActiveModel::Naming
en:
activerecord:
models:
something:
one: Something
other: Somethings
class Something
extend ActiveModel::Naming
end
Something.model_name.human(count: :many) # => "Something"
class Something
extend ActiveModel::Naming
extend ActiveModel::Translation
end
Something.model_name.human(count: :many) # => "Somethings"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment