aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2011-05-25 02:28:41 +0200
committerJosh Kalderimis <josh.kalderimis@gmail.com>2011-05-25 02:29:32 +0200
commit542114e1d82fffa1062ef0eaa1053959ab9d14ec (patch)
treebbeecf790f95cef0f33c7dd4fd029aef3cc1eb90 /activerecord/lib/active_record/base.rb
parent52e01fc59dfcadaa0fd7773fb4d9a04dff297ce8 (diff)
downloadrails-542114e1d82fffa1062ef0eaa1053959ab9d14ec.tar.gz
rails-542114e1d82fffa1062ef0eaa1053959ab9d14ec.tar.bz2
rails-542114e1d82fffa1062ef0eaa1053959ab9d14ec.zip
removed deprecated methods, and related tests, from ActiveRecord
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 99930e7697..f6a80b8bce 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1662,9 +1662,6 @@ MSG
# If any attributes are protected by either +attr_protected+ or
# +attr_accessible+ then only settable attributes will be assigned.
#
- # The +guard_protected_attributes+ argument is now deprecated, use
- # the +assign_attributes+ method if you want to bypass mass-assignment security.
- #
# class User < ActiveRecord::Base
# attr_protected :is_admin
# end
@@ -1673,20 +1670,10 @@ MSG
# user.attributes = { :username => 'Phusion', :is_admin => true }
# user.username # => "Phusion"
# user.is_admin? # => false
- def attributes=(new_attributes, guard_protected_attributes = nil)
- unless guard_protected_attributes.nil?
- message = "the use of 'guard_protected_attributes' will be removed from the next major release of rails, " +
- "if you want to bypass mass-assignment security then look into using assign_attributes"
- ActiveSupport::Deprecation.warn(message)
- end
-
+ def attributes=(new_attributes)
return unless new_attributes.is_a?(Hash)
- if guard_protected_attributes == false
- assign_attributes(new_attributes, :without_protection => true)
- else
- assign_attributes(new_attributes)
- end
+ assign_attributes(new_attributes)
end
# Allows you to set all the attributes for a particular mass-assignment