aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2012-07-19 08:57:48 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2012-09-16 23:58:20 -0500
commit8c4de0e67fc22fecf70a230d2178a00b2b24b18d (patch)
treeab3054802266fa1cc6411b610f399081155e7d82 /actionpack/lib
parentd695fdbd1181a002595ae2d80e2ee6955801b602 (diff)
downloadrails-8c4de0e67fc22fecf70a230d2178a00b2b24b18d.tar.gz
rails-8c4de0e67fc22fecf70a230d2178a00b2b24b18d.tar.bz2
rails-8c4de0e67fc22fecf70a230d2178a00b2b24b18d.zip
Remove integration between attr_accessible/protected and AC::Metal::ParamsWrapper
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/metal/params_wrapper.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb
index 2736948ce0..bbb711b49d 100644
--- a/actionpack/lib/action_controller/metal/params_wrapper.rb
+++ b/actionpack/lib/action_controller/metal/params_wrapper.rb
@@ -42,9 +42,7 @@ module ActionController
# end
#
# On ActiveRecord models with no +:include+ or +:exclude+ option set,
- # if attr_accessible is set on that model, it will only wrap the accessible
- # parameters, else it will only wrap the parameters returned by the class
- # method attribute_names.
+ # it will only wrap the parameters returned by the class method attribute_names.
#
# If you're going to pass the parameters to an +ActiveModel+ object (such as
# <tt>User.new(params[:user])</tt>), you might consider passing the model class to
@@ -165,10 +163,7 @@ module ActionController
unless options[:include] || options[:exclude]
model ||= _default_wrap_model
- role = options.fetch(:as, :default)
- if model.respond_to?(:accessible_attributes) && model.accessible_attributes(role).present?
- options[:include] = model.accessible_attributes(role).to_a
- elsif model.respond_to?(:attribute_names) && model.attribute_names.present?
+ if model.respond_to?(:attribute_names) && model.attribute_names.present?
options[:include] = model.attribute_names
end
end