diff options
Diffstat (limited to 'activemodel/lib/active_model/type/helpers')
4 files changed, 12 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/type/helpers/accepts_multiparameter_time.rb b/activemodel/lib/active_model/type/helpers/accepts_multiparameter_time.rb index f783d286c5..ad891f841e 100644 --- a/activemodel/lib/active_model/type/helpers/accepts_multiparameter_time.rb +++ b/activemodel/lib/active_model/type/helpers/accepts_multiparameter_time.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActiveModel module Type module Helpers # :nodoc: all @@ -19,6 +21,10 @@ module ActiveModel end end + define_method(:value_constructed_by_mass_assignment?) do |value| + value.is_a?(Hash) + end + define_method(:value_from_multiparameter_assignment) do |values_hash| defaults.each do |k, v| values_hash[k] ||= v diff --git a/activemodel/lib/active_model/type/helpers/mutable.rb b/activemodel/lib/active_model/type/helpers/mutable.rb index f3a17a1698..1cbea644c4 100644 --- a/activemodel/lib/active_model/type/helpers/mutable.rb +++ b/activemodel/lib/active_model/type/helpers/mutable.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActiveModel module Type module Helpers # :nodoc: all diff --git a/activemodel/lib/active_model/type/helpers/numeric.rb b/activemodel/lib/active_model/type/helpers/numeric.rb index 275822b738..16e14f9e5f 100644 --- a/activemodel/lib/active_model/type/helpers/numeric.rb +++ b/activemodel/lib/active_model/type/helpers/numeric.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ActiveModel module Type module Helpers # :nodoc: all diff --git a/activemodel/lib/active_model/type/helpers/time_value.rb b/activemodel/lib/active_model/type/helpers/time_value.rb index 53cf7c6029..250c4021c6 100644 --- a/activemodel/lib/active_model/type/helpers/time_value.rb +++ b/activemodel/lib/active_model/type/helpers/time_value.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_support/core_ext/time/zones" module ActiveModel |