Skip to content

Commit

Permalink
Merge pull request #17834 from mzazrivec/add_ui_option_to_human_attri…
Browse files Browse the repository at this point in the history
…bute_name

human_attribute_name():  add ui option to be able to call original (super) method
  • Loading branch information
martinpovolny authored Aug 10, 2018
2 parents b9e79cc + b4fc632 commit f611ec7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/application_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def self.display_name(number = 1)
n_(model_name.singular.titleize, model_name.plural.titleize, number)
end

def self.human_attribute_name(attribute, *args)
def self.human_attribute_name(attribute, options = {})
return super if options.delete(:ui) == true
"#{name}: #{super}"
end
end

0 comments on commit f611ec7

Please sign in to comment.