aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/nodes/sql_literal.rb
diff options
context:
space:
mode:
authorIvan Antropov <antropov.ivan@gmail.com>2013-11-09 10:16:19 +0700
committerIvan Antropov <antropov.ivan@gmail.com>2013-11-09 10:16:19 +0700
commitfcb00d388c8afe25cdc8bd0fa5c762840921a8c9 (patch)
treedd6f888849febb205c602859482598affbe0ccb2 /lib/arel/nodes/sql_literal.rb
parent9e53488b1d8d535182a989bd38fbb171aebbeef5 (diff)
downloadrails-fcb00d388c8afe25cdc8bd0fa5c762840921a8c9.tar.gz
rails-fcb00d388c8afe25cdc8bd0fa5c762840921a8c9.tar.bz2
rails-fcb00d388c8afe25cdc8bd0fa5c762840921a8c9.zip
Add :encode_with for proper YAML serialization
Diffstat (limited to 'lib/arel/nodes/sql_literal.rb')
-rw-r--r--lib/arel/nodes/sql_literal.rb4
1 files changed, 4 insertions, 0 deletions
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