Ticket #8760: deprecate_arb_human_attribute_name.2.diff
| File deprecate_arb_human_attribute_name.2.diff, 2.0 kB (added by kampers, 1 year ago) |
|---|
-
activerecord/lib/active_record/validations.rb
old new 176 176 if attr == "base" 177 177 full_messages << msg 178 178 else 179 full_messages << @base.class.human_attribute_name(attr)+ " " + msg179 full_messages << attr.humanize + " " + msg 180 180 end 181 181 end 182 182 end -
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
old new 94 94 # ===== Examples 95 95 # Column.new('sales_stage', ...).human_name #=> 'Sales stage' 96 96 def human_name 97 Base.human_attribute_name(@name)97 @name.humanize 98 98 end 99 99 100 100 def extract_default(default) -
activerecord/lib/active_record/base.rb
old new 1134 1134 1135 1135 # Transforms attribute key names into a more humane format, such as "First name" instead of "first_name". Example: 1136 1136 # Person.human_attribute_name("first_name") # => "First name" 1137 # Deprecated in favor of just calling "first_name".humanize1137 # This is deprecated in favor of calling "first_name".humanize directly. 1138 1138 def human_attribute_name(attribute_key_name) #:nodoc: 1139 1139 attribute_key_name.humanize 1140 1140 end 1141 deprecate :human_attribute_name => 'use humanize inflector instead' 1141 1142 1142 1143 # True if this isn't a concrete subclass needing a STI type condition. 1143 1144 def descends_from_active_record?