Skip to content

Commit 4750e61

Browse files
Jeff Kreeftmeijerjosevalim
authored andcommitted
using :time_select when the attribute type is :time in the scaffold generator. [rails#2377 state:resolved]
Signed-off-by: José Valim <[email protected]>
1 parent afe57dd commit 4750e61

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

railties/lib/rails/generators/generated_attribute.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ def initialize(name, type)
99

1010
def field_type
1111
@field_type ||= case type
12-
when :integer, :float, :decimal then :text_field
13-
when :datetime, :timestamp, :time then :datetime_select
14-
when :date then :date_select
15-
when :string then :text_field
16-
when :text then :text_area
17-
when :boolean then :check_box
12+
when :integer, :float, :decimal then :text_field
13+
when :time then :time_select
14+
when :datetime, :timestamp then :datetime_select
15+
when :date then :date_select
16+
when :string then :text_field
17+
when :text then :text_area
18+
when :boolean then :check_box
1819
else
1920
:text_field
2021
end

0 commit comments

Comments
 (0)