Ticket #8760: deprecate_arb_human_attribute_name.diff
| File deprecate_arb_human_attribute_name.diff, 2.0 kB (added by kampers, 2 years ago) |
|---|
-
activerecord/lib/active_record/validations.rb
old new 189 189 if attr == "base" 190 190 full_messages << msg 191 191 else 192 full_messages << @base.class.human_attribute_name(attr)+ " " + msg192 full_messages << attr.humanize + " " + msg 193 193 end 194 194 end 195 195 end -
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
old new 89 89 # ===== Examples 90 90 # Column.new('sales_stage', ...).human_name #=> 'Sales stage' 91 91 def human_name 92 Base.human_attribute_name(@name)92 @name.humanize 93 93 end 94 94 95 95 # Used to convert from Strings to BLOBs -
activerecord/lib/active_record/base.rb
old new 892 892 893 893 # Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example: 894 894 # Person.human_attribute_name("first_name") # => "First name" 895 # Deprecated in favor of just calling "first_name".humanize895 # This is deprecated in favor of calling "first_name".humanize directly. 896 896 def human_attribute_name(attribute_key_name) #:nodoc: 897 897 attribute_key_name.humanize 898 898 end 899 deprecate :human_attribute_name => 'use humanize inflector instead' 899 900 900 901 # True if this isn't a concrete subclass needing a STI type condition. 901 902 def descends_from_active_record?