提交 f4fbc030 编写于 作者: C Carlos Antonio da Silva

Remove support for the protected attributes gem

Related to #10690.
上级 d8b8a726
* Remove support for the `protected_attributes` gem.
*Carlos Antonio da Silva + Roberto Miranda*
* Fix accessing of fixtures having non-string labels like Fixnum.
*Prathamesh Sonpatki*
......
......@@ -274,16 +274,14 @@ def table_metadata # :nodoc:
# ==== Example:
# # Instantiates a single new object
# User.new(first_name: 'Jamie')
def initialize(attributes = nil, options = {})
def initialize(attributes = nil)
@attributes = self.class._default_attributes.dup
self.class.define_attribute_methods
init_internals
initialize_internals_callback
# +options+ argument is only needed to make protected_attributes gem easier to hook.
# Remove it when we drop support to this gem.
init_attributes(attributes, options) if attributes
assign_attributes(attributes) if attributes
yield self if block_given?
_run_initialize_callbacks
......@@ -557,12 +555,6 @@ def init_internals
def initialize_internals_callback
end
# This method is needed to make protected_attributes gem easier to hook.
# Remove it when we drop support to this gem.
def init_attributes(attributes, options)
assign_attributes(attributes)
end
def thaw
if frozen?
@attributes = @attributes.dup
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册