aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2015-10-29 11:15:19 -0600
committerSean Griffin <sean@seantheprogrammer.com>2015-10-29 11:15:19 -0600
commitf2ae4af9e122fd1daa95fd7249bdcf1068ebeecb (patch)
tree8073c86c3f1e025e0e279db2ed1492081dada441 /actionview/lib/action_view
parent462698b2c704eff962060ed5851af80f4215958b (diff)
downloadrails-f2ae4af9e122fd1daa95fd7249bdcf1068ebeecb.tar.gz
rails-f2ae4af9e122fd1daa95fd7249bdcf1068ebeecb.tar.bz2
rails-f2ae4af9e122fd1daa95fd7249bdcf1068ebeecb.zip
Fix style issues with #16252
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/helpers/date_helper.rb13
1 files changed, 5 insertions, 8 deletions
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