Permalink
Browse files

human_name has been deprecated, please use model_name.human instead

  • Loading branch information...
1 parent 39c22b1 commit 07f01561992294a4c0ea4807e98bad8d33e834d1 @sobrinho sobrinho committed Apr 19, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/formtastic.rb
View
@@ -327,8 +327,8 @@ def commit_button(*args)
# ActiveRecord::Base.human_name falls back to ActiveRecord::Base.name.humanize ("Userpost")
# if there's no i18n, which is pretty crappy. In this circumstance we want to detect this
# fall back (human_name == name.humanize) and do our own thing name.underscore.humanize ("User Post")
- if @object.class.respond_to?(:human)
- object_name = @object.class.human
+ if @object.class.respond_to?(:model_name)
+ object_name = @object.class.model_name.human
else
object_human_name = @object.class.human_name # default is UserPost => "Userpost", but i18n may do better ("User post")
crappy_human_name = @object.class.name.humanize # UserPost => "Userpost"

0 comments on commit 07f0156

Please sign in to comment.