Created
March 5, 2012 20:54
-
-
Save brentkirby/1981007 to your computer and use it in GitHub Desktop.
naming fix for active model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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