diff options
author | Daniel Colson <danieljamescolson@gmail.com> | 2018-02-07 16:14:45 -0500 |
---|---|---|
committer | Daniel Colson <danieljamescolson@gmail.com> | 2018-02-07 18:11:14 -0500 |
commit | 043ce35b18662e46cb5b0d9cf203f4da4eefc421 (patch) | |
tree | 8ae98f8e58c717b6a676ee88338d3dbba59ee444 /activemodel/lib/active_model | |
parent | 5ae2ecab6d3365f6f17e3c8cb298dfeeea113774 (diff) | |
download | rails-043ce35b18662e46cb5b0d9cf203f4da4eefc421.tar.gz rails-043ce35b18662e46cb5b0d9cf203f4da4eefc421.tar.bz2 rails-043ce35b18662e46cb5b0d9cf203f4da4eefc421.zip |
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.
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/attributes.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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) |