rubydb-activerecord 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 58409e5dd807a01080f4c273c80f4717774268f5eb718ee91967c4133edf8d2a
|
|
4
|
+
data.tar.gz: cf9e28b8e875e503a569b24b16621f7598ed0b06a9bcc184b7c7ceee52282b6a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5f0d247b93310e35e2683473d3b6a177152698acfeefdfc73f5fd2844398b54e67c61b40bd5ac6fc8a2e767e814335f858c9e89c30fb07ab20c6176227c7576
|
|
7
|
+
data.tar.gz: 5adc967daaace477a103298d1d9c8864beb05c33fe87e218a1d2fac67b8af38db780515b5dfda1e1b0a88263591978d25a37bba7c4ab84cf212d32b391345574
|
|
@@ -756,10 +756,15 @@ module ActiveRecord
|
|
|
756
756
|
|
|
757
757
|
# ActiveRecord's generic Column deduplication is string-oriented. RubyDB
|
|
758
758
|
# persists typed defaults, so serialize scalar defaults at this boundary
|
|
759
|
-
# and let ActiveRecord cast them through the column type map.
|
|
760
|
-
def rails_default_value(value)
|
|
761
|
-
|
|
762
|
-
|
|
759
|
+
# and let ActiveRecord cast them through the column type map.
|
|
760
|
+
def rails_default_value(value)
|
|
761
|
+
# RubyDB exposes SQL defaults as AST literals. ActiveRecord expects
|
|
762
|
+
# the scalar payload when it builds its Column metadata; calling
|
|
763
|
+
# `to_s` on the wrapper would leak the Ruby object inspection into
|
|
764
|
+
# newly instantiated records.
|
|
765
|
+
value = value.value if value.respond_to?(:value) && !value.is_a?(String)
|
|
766
|
+
value.is_a?(String) ? value : value.to_s
|
|
767
|
+
end
|
|
763
768
|
|
|
764
769
|
def sql_for_execution(sql)
|
|
765
770
|
sql = sql.to_sql if sql.respond_to?(:to_sql)
|
data/rubydb-activerecord.gemspec
CHANGED