kbingman/paperclipped — Issue #40: wrong number of arguments in validates_attachment_size during upload
Author: daveharris
Created: 2011-12-01 22:13:41+00:00
State: open

Hi,
When I try to upload a new asset, I get the below an error message

I have an older application running on
* Papercliped version 2.2.8
* Paperclip version 2.3.1 (vendorized)
* Radiant version 0.8.2
* Rails version 2.3.4
* Ruby version 1.8.7 (i686-darwin11.0.0)
* RubyGems version 1.4.2
* Rack version 1.0

I am wondering whether there is an incompatibility between the version of rails/radiant/paperclip/paperclipped?

What version of paperclip do I need to run with paperclipped v2.2.8?

Thanks,
Dave

The error message is:
````
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:229:in `validates_attachment_size'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:284:in `[]'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:284:in `allow_validation?'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:274:in `validate'
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:229:in `inject'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `each'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `inject'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:272:in `validate'
/Users/dave/code/app/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/attachment.rb:93:in `assign'
/Users/dave/code/app/vendor/extensions/paperclipped/vendor/plugins/paperclip/lib/paperclip.rb:204:in `asset='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2744:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2744:in `attributes='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2740:in `each'
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2740:in `attributes='
/Users/dave/code/app/vendor/radiant/vendor/rails/activerecord/lib/active_record/base.rb:2438:in `initialize'
/Users/dave/code/app/vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:22:in `new'
/Users/dave/code/app/vendor/extensions/paperclipped/app/controllers/admin/assets_controller.rb:22:in `create'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dave/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dave/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/Users/dave/code/app/vendor/radiant/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/flash.rb:146:in `perform_action'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `send'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process_without_filters'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `sass_old_process'
/Users/dave/code/app/vendor/radiant/vendor/plugins/haml/lib/sass/plugin/rails.rb:19:in `process'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
/Users/dave/code/app/vendor/radiant/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:437:in `call'
````

The request attributes are:
````
{"commit"=>"Create Asset",
"format"=>"html",
"authenticity_token"=>"2TOdLSQ/KEnE6IR0VVxd2OlfhoAH+9OqGUvj3TIPYGs=",
"asset"=>{"title"=>"moving-house-image",
"caption"=>"",
"asset"=>#}}
````