aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/type/time.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-02-18 03:16:23 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-02-18 04:20:52 +0900
commit907280ddfd78c53e2eb5af6f12512dc38df38bd8 (patch)
tree445db778f4e92d73acec0896e068f978c7ed6383 /activemodel/lib/active_model/type/time.rb
parent07346c4b35df191cfb05353a0a9f3e2f30faca65 (diff)
downloadrails-907280ddfd78c53e2eb5af6f12512dc38df38bd8.tar.gz
rails-907280ddfd78c53e2eb5af6f12512dc38df38bd8.tar.bz2
rails-907280ddfd78c53e2eb5af6f12512dc38df38bd8.zip
Fix type cast with values hash for Date type
`value_from_multiparameter_assignment` defined by `AcceptsMultiparameterTime` helper requires `default_timezone` method which is defined at `TimeValue` helper. Since `Date` type doesn't include `TimeValue`, I've extracted `Timezone` helper to be shared by `Date`, `DateTime`, and `Time` types.
Diffstat (limited to 'activemodel/lib/active_model/type/time.rb')
-rw-r--r--activemodel/lib/active_model/type/time.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/type/time.rb b/activemodel/lib/active_model/type/time.rb
index 8fba01b86a..61847a4ce7 100644
--- a/activemodel/lib/active_model/type/time.rb
+++ b/activemodel/lib/active_model/type/time.rb
@@ -3,6 +3,7 @@
module ActiveModel
module Type
class Time < Value # :nodoc:
+ include Helpers::Timezone
include Helpers::TimeValue
include Helpers::AcceptsMultiparameterTime.new(
defaults: { 1 => 2000, 2 => 1, 3 => 1, 4 => 0, 5 => 0 }