diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-15 16:13:29 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-15 16:13:29 -0700 |
commit | d043d6539682f804a696d301b580accfc68f6cce (patch) | |
tree | d1303b0c4dc8a2ed14725c12eec300b7e1fa3bb5 /actionpack/lib/action_controller/metal | |
parent | 6e581cce1c1116d71484a5a4a5f92f0ea6fd29e4 (diff) | |
parent | d77b306b63e20aabec5daf7159d31c8ee31492c9 (diff) | |
download | rails-d043d6539682f804a696d301b580accfc68f6cce.tar.gz rails-d043d6539682f804a696d301b580accfc68f6cce.tar.bz2 rails-d043d6539682f804a696d301b580accfc68f6cce.zip |
Merge pull request #570 from sikachu/decouple_actionpack
Make ParamsWrapper use a well-defined API and not rely on AR methods
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r-- | actionpack/lib/action_controller/metal/params_wrapper.rb | 6 |
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 |