1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix style issues with #16252

This commit is contained in:
Sean Griffin 2015-10-29 11:15:19 -06:00
parent 462698b2c7
commit f2ae4af9e1
2 changed files with 9 additions and 12 deletions

View file

@ -1,3 +1,7 @@
* Allow `date_select` helper selected option to accept hash like the default options.
*Lecky Lao*
* Collection input propagates input's `id` to the label's `for` attribute when
using html options as the last element of collection.
@ -208,8 +212,4 @@
*Daniel Gomez de Souza*
* Allow date_select helper selected option to accept hash like the default options.
*Lecky Lao*
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionview/CHANGELOG.md) for previous changes.

View file

@ -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