aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorGustavo Beathyate <gustavo.bt@me.com>2014-07-15 15:50:29 -0500
committerGustavo Beathyate <gustavo.bt@me.com>2014-07-15 15:50:29 -0500
commitb8e8096a89b0405544c8004c9c445a7894cf7ec9 (patch)
tree1ba173e39dfb8a9f352fe5fa9955d28212eac278 /activerecord
parentc3f4d6c8feafab9ded8b549d745c4731ee17b5c4 (diff)
downloadrails-b8e8096a89b0405544c8004c9c445a7894cf7ec9.tar.gz
rails-b8e8096a89b0405544c8004c9c445a7894cf7ec9.tar.bz2
rails-b8e8096a89b0405544c8004c9c445a7894cf7ec9.zip
Implement required #encode_with
While running the spec `ARCONN=mysql2 ruby -v -Itest test/cases/yaml_serialization_test.rb` the following warning shows up: `implementing to_yaml is deprecated, please implement "encode_with"`
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/delegation.rb4
-rw-r--r--activerecord/test/cases/yaml_serialization_test.rb1
2 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb
index 50f4d5c7ab..df3ac43b0a 100644
--- a/activerecord/lib/active_record/relation/delegation.rb
+++ b/activerecord/lib/active_record/relation/delegation.rb
@@ -119,6 +119,10 @@ module ActiveRecord
arel.respond_to?(method, include_private)
end
+ def encode_with(coder)
+ coder.represent_seq(nil, to_a)
+ end
+
protected
def array_delegable?(method)
diff --git a/activerecord/test/cases/yaml_serialization_test.rb b/activerecord/test/cases/yaml_serialization_test.rb
index 9f1d110ddb..bce59b4fcd 100644
--- a/activerecord/test/cases/yaml_serialization_test.rb
+++ b/activerecord/test/cases/yaml_serialization_test.rb
@@ -1,5 +1,6 @@
require 'cases/helper'
require 'models/topic'
+require 'models/reply'
require 'models/post'
require 'models/author'