aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/type/immutable_string.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/activemodel/lib/active_model/type/immutable_string.rb b/activemodel/lib/active_model/type/immutable_string.rb
index c967d428ac..58268540e5 100644
--- a/activemodel/lib/active_model/type/immutable_string.rb
+++ b/activemodel/lib/active_model/type/immutable_string.rb
@@ -8,8 +8,8 @@ module ActiveModel
def serialize(value)
case value
when ::Numeric, ActiveSupport::Duration then value.to_s
- when true then casted_true
- when false then casted_false
+ when true then "t"
+ when false then "f"
else super
end
end
@@ -19,20 +19,12 @@ module ActiveModel
def cast_value(value)
result = \
case value
- when true then casted_true
- when false then casted_false
+ when true then "t"
+ when false then "f"
else value.to_s
end
result.freeze
end
-
- def casted_true
- "t".freeze
- end
-
- def casted_false
- "f".freeze
- end
end
end
end