Fix Input HTML Value Default and Non Date Time Inputs #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does two things that have regressed in
active_admin_datetimepicker
in 0.7.2.The first issue is that we could previously pass in integers, String, etc for a model attribute and the date picker will still render. With this change however https://github.com/activeadmin-plugins/active_admin_datetimepicker/blob/master/lib/active_admin_datetimepicker/base.rb#L34, we now get an error that
min
is not a method on the value. It may seem wonky that we would want to render a date picker for a non date field but that was our use case. We'd massage the value pack to the integer in the AA controller. Perhaps this should be a configuration with an explicit warning or raise, vs attempting to callmin
when it will fail.The second seems like a straight up bug, with the
input_html: { value: X }
no longer being set in the date picker.This PR attempts to fix both.