From fcb00d388c8afe25cdc8bd0fa5c762840921a8c9 Mon Sep 17 00:00:00 2001 From: Ivan Antropov Date: Sat, 9 Nov 2013 10:16:19 +0700 Subject: Add :encode_with for proper YAML serialization --- lib/arel/nodes/sql_literal.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/arel') diff --git a/lib/arel/nodes/sql_literal.rb b/lib/arel/nodes/sql_literal.rb index 1bae8c9366..b43288b29c 100644 --- a/lib/arel/nodes/sql_literal.rb +++ b/lib/arel/nodes/sql_literal.rb @@ -5,6 +5,10 @@ module Arel include Arel::Predications include Arel::AliasPredication include Arel::OrderPredications + + def encode_with(coder) + coder.scalar = self.to_s + end end class BindParam < SqlLiteral -- cgit v1.2.3