lib/dryml/template.rb in dryml-1.3.0.pre28 vs lib/dryml/template.rb in dryml-1.3.0.pre29
- old
+ new
@@ -269,10 +269,12 @@
if for_type
type_name = if defined?(HoboFields) && for_type =~ /^[a-z]/
# It's a symbolic type name - look up the Ruby type name
klass = HoboFields.to_class(for_type) or
dryml_exception("No such type in polymorphic tag definition: '#{for_type}'", el)
- for_type
+ # ActiveSupport::TimeWithZone.name would return 'Time'
+ # so we add an exception to pick the right datetime type
+ klass == ActiveSupport::TimeWithZone ? 'datetime' : klass.name
else
for_type
end.underscore.gsub('/', '__')
"__for_#{type_name}"
end