Permalink
Browse files

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"`
  • Loading branch information...
1 parent c3f4d6c commit b8e8096a89b0405544c8004c9c445a7894cf7ec9 @goddamnhippie goddamnhippie committed Jul 15, 2014
View
4 activerecord/lib/active_record/relation/delegation.rb
@@ -119,6 +119,10 @@ def respond_to?(method, include_private = false)
arel.respond_to?(method, include_private)
end
+ def encode_with(coder)
+ coder.represent_seq(nil, to_a)
+ end
+
protected
def array_delegable?(method)
View
1 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'

0 comments on commit b8e8096

Please sign in to comment.