aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/type
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/lib/active_model/type')
-rw-r--r--activemodel/lib/active_model/type/date_time.rb4
-rw-r--r--activemodel/lib/active_model/type/helpers/time_value.rb2
-rw-r--r--activemodel/lib/active_model/type/value.rb6
3 files changed, 6 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/type/date_time.rb b/activemodel/lib/active_model/type/date_time.rb
index f88c9e5071..5cb0077e45 100644
--- a/activemodel/lib/active_model/type/date_time.rb
+++ b/activemodel/lib/active_model/type/date_time.rb
@@ -19,8 +19,8 @@ module ActiveModel
fast_string_to_time(value) || fallback_string_to_time(value)
end
- # '0.123456' -> 123456
- # '1.123456' -> 123456
+ # '0.123456' -> 123456
+ # '1.123456' -> 123456
def microseconds(time)
time[:sec_fraction] ? (time[:sec_fraction] * 1_000_000).to_i : 0
end
diff --git a/activemodel/lib/active_model/type/helpers/time_value.rb b/activemodel/lib/active_model/type/helpers/time_value.rb
index 64780ebbdc..d8c5d929a3 100644
--- a/activemodel/lib/active_model/type/helpers/time_value.rb
+++ b/activemodel/lib/active_model/type/helpers/time_value.rb
@@ -64,7 +64,7 @@ module ActiveModel
ISO_DATETIME = /\A(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)(\.\d+)?\z/
- # Doesn't handle time zones.
+ # Doesn't handle time zones.
def fast_string_to_time(string)
if string =~ ISO_DATETIME
microsec = ($7.to_r * 1_000_000).to_i
diff --git a/activemodel/lib/active_model/type/value.rb b/activemodel/lib/active_model/type/value.rb
index 4d3a1b29d6..7e9ae92245 100644
--- a/activemodel/lib/active_model/type/value.rb
+++ b/activemodel/lib/active_model/type/value.rb
@@ -105,9 +105,9 @@ module ActiveModel
private
- # Convenience method for types which do not need separate type casting
- # behavior for user and database inputs. Called by Value#cast for
- # values except +nil+.
+ # Convenience method for types which do not need separate type casting
+ # behavior for user and database inputs. Called by Value#cast for
+ # values except +nil+.
def cast_value(value) # :doc:
value
end