From f2ae4af9e122fd1daa95fd7249bdcf1068ebeecb Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Thu, 29 Oct 2015 11:15:19 -0600 Subject: Fix style issues with #16252 --- actionview/lib/action_view/helpers/date_helper.rb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb index c69e4cc77e..233e613e97 100644 --- a/actionview/lib/action_view/helpers/date_helper.rb +++ b/actionview/lib/action_view/helpers/date_helper.rb @@ -845,14 +845,11 @@ module ActionView private %w( sec min hour day month year ).each do |method| define_method(method) do - if @datetime - if @datetime.kind_of?(Hash) - @datetime[method.to_sym] - elsif @datetime.kind_of?(Numeric) - @datetime - else - @datetime.send(method) - end + case @datetime + when Hash then @datetime[method.to_sym] + when Numeric then @datetime + when nil then nil + else @datetime.send(method) end end end -- cgit v1.2.3