From 043ce35b18662e46cb5b0d9cf203f4da4eefc421 Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Wed, 7 Feb 2018 16:14:45 -0500 Subject: Add ActiveModel::Attributes#attributes This starts to fix #31832. ActiveModel::Attributes includes ActiveModel::AttributeMethods, which requires an `#attributes` method that returns a hash with string keys. --- activemodel/lib/active_model/attributes.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activemodel/lib/active_model/attributes.rb') diff --git a/activemodel/lib/active_model/attributes.rb b/activemodel/lib/active_model/attributes.rb index 046ae67ad7..4083bf827b 100644 --- a/activemodel/lib/active_model/attributes.rb +++ b/activemodel/lib/active_model/attributes.rb @@ -66,6 +66,10 @@ module ActiveModel super end + def attributes + @attributes.to_hash + end + private def write_attribute(attr_name, value) -- cgit v1.2.3