aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-02-28 00:17:43 -0500
committerGitHub <noreply@github.com>2018-02-28 00:17:43 -0500
commitea70d20441a745ba3ace2e82071ccb1ef56daf2e (patch)
tree9cad5cc0772bd4092716e8e814b609e245d45baa /activemodel/lib
parenta14a6b8834fc35136aa0e52bb27fd73f75f83c0b (diff)
parent043ce35b18662e46cb5b0d9cf203f4da4eefc421 (diff)
downloadrails-ea70d20441a745ba3ace2e82071ccb1ef56daf2e.tar.gz
rails-ea70d20441a745ba3ace2e82071ccb1ef56daf2e.tar.bz2
rails-ea70d20441a745ba3ace2e82071ccb1ef56daf2e.zip
Merge pull request #31926 from composerinteralia/am-attributes
Add ActiveModel::Attributes#attributes
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/attributes.rb4
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)