Skip to content

Commit

Permalink
update CapitalizeDecorator to handle scenario where the @nameable obj…
Browse files Browse the repository at this point in the history
…ect is not a Person
  • Loading branch information
kessie2862 committed Aug 1, 2023
1 parent 55c53ac commit 9446402
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion capitalize_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class CapitalizeDecorator < Decorator
def correct_name
super.capitalize
nameable_name = @nameable.respond_to?(:correct_name) ? @nameable.correct_name : @nameable
nameable_name.to_s.capitalize
end
end

0 comments on commit 9446402

Please sign in to comment.