aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2015-01-09 21:55:52 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2015-01-09 22:42:29 -0200
commitf4fbc0301021f13ae05c8e941c8efc4ae351fdf9 (patch)
treebf668996dc32201831f67e6b5a6b14642c37fe94
parentd8b8a726e7b7290b380b3b1274484b08449deaf2 (diff)
downloadrails-f4fbc0301021f13ae05c8e941c8efc4ae351fdf9.tar.gz
rails-f4fbc0301021f13ae05c8e941c8efc4ae351fdf9.tar.bz2
rails-f4fbc0301021f13ae05c8e941c8efc4ae351fdf9.zip
Remove support for the protected attributes gem
Related to #10690.
-rw-r--r--activerecord/CHANGELOG.md4
-rw-r--r--activerecord/lib/active_record/core.rb12
2 files changed, 6 insertions, 10 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 3c4f06ccf8..9592ff7030 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
+* 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*
diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb
index 5a5139256d..a7aff9f724 100644
--- a/activerecord/lib/active_record/core.rb
+++ b/activerecord/lib/active_record/core.rb
@@ -274,16 +274,14 @@ module ActiveRecord
# ==== 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 @@ module ActiveRecord
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