aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/type/decimal_without_scale.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/type/decimal_without_scale.rb')
-rw-r--r--activerecord/lib/active_record/type/decimal_without_scale.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/type/decimal_without_scale.rb b/activerecord/lib/active_record/type/decimal_without_scale.rb
new file mode 100644
index 0000000000..a207940dc7
--- /dev/null
+++ b/activerecord/lib/active_record/type/decimal_without_scale.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module ActiveRecord
+ module Type
+ class DecimalWithoutScale < ActiveModel::Type::BigInteger # :nodoc:
+ def type
+ :decimal
+ end
+
+ def type_cast_for_schema(value)
+ value.to_s.inspect
+ end
+ end
+ end
+end