From fcf5dbd75149cdcf5e2ed93350f321d5f0b61cf0 Mon Sep 17 00:00:00 2001 From: Chris Arcand Date: Tue, 3 Jan 2017 22:38:41 -0600 Subject: [PATCH] Add _default_attributes to acts_as_ar_model _default_attributes is a set of default attributes for the internal API of ActiveRecord models added in 5.0.1. --- lib/acts_as_ar_model.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/acts_as_ar_model.rb b/lib/acts_as_ar_model.rb index 808a37923dd..fbe4cb4b294 100644 --- a/lib/acts_as_ar_model.rb +++ b/lib/acts_as_ar_model.rb @@ -53,6 +53,10 @@ def attribute_types @attribute_types ||= Hash.new(ActiveModel::Type::Value.new) end + def _default_attributes + @default_attributes ||= ActiveRecord::AttributeSet.new({}) + end + def attribute_names load_schema attribute_types.keys