Skip to content

Instantly share code, notes, and snippets.

@brentkirby
Created March 5, 2012 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brentkirby/1981007 to your computer and use it in GitHub Desktop.
Save brentkirby/1981007 to your computer and use it in GitHub Desktop.
naming fix for active model
def self.model_name
name = "Entry"
name.instance_eval do
def plural; pluralize; end
def singular; singularize; end
def i18n_key; singularize; end
def human(*args); singularize; end
end
return name
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment