aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-05-15 14:25:00 -0400
committerPrem Sichanugrist <s@sikachu.com>2011-05-15 19:07:44 -0400
commitd77b306b63e20aabec5daf7159d31c8ee31492c9 (patch)
tree74bf89347455aabce1f3a4e0fe080097da9e08fe /actionpack/lib/action_controller/metal
parent5ca67eca21d2adfb418f96b63e7d3de237737a1e (diff)
downloadrails-d77b306b63e20aabec5daf7159d31c8ee31492c9.tar.gz
rails-d77b306b63e20aabec5daf7159d31c8ee31492c9.tar.bz2
rails-d77b306b63e20aabec5daf7159d31c8ee31492c9.zip
Make ParamsWrapper calling newly introduced `Model.attribute_names` instead of `.column_names`
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/params_wrapper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb
index b18be60201..aa7c1e09c2 100644
--- a/actionpack/lib/action_controller/metal/params_wrapper.rb
+++ b/actionpack/lib/action_controller/metal/params_wrapper.rb
@@ -145,7 +145,7 @@ module ActionController
begin
model_klass = model_name.constantize
rescue NameError, ArgumentError => e
- if e.message =~ /is not missing constant|uninitialized constant #{model_name}/
+ if e.message =~ /is not missing constant|uninitialized constant #{model_name}/
namespaces = model_name.split("::")
namespaces.delete_at(-2)
break if namespaces.last == model_name
@@ -163,8 +163,8 @@ module ActionController
unless options[:only] || options[:except]
model ||= _default_wrap_model
- if !(model.respond_to?(:abstract_class?) && model.abstract_class?) && model.respond_to?(:column_names)
- options[:only] = model.column_names
+ if model.respond_to?(:attribute_names) && model.attribute_names.present?
+ options[:only] = model.attribute_names
end
end