ging/social_stream — Issue #203: Populate fails because of Avatar populatio
Author: Roendal
Created: 2012-01-26 20:20:14+00:00
State: open

I get this log when doing the populate

```

Avatar population
rake aborted!
undefined method `call' for :uploading_file?:Symbol
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/paperclip-2.4.5/lib/paperclip.rb:391:in `validates_attachment_presence'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validator.rb:181:in `call'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validator.rb:181:in `validate_each'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validator.rb:153:in `validate'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validator.rb:150:in `each'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validator.rb:150:in `validate'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:310:in `send'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:310:in `_callback_before_411'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:418:in `_run__920379347__validate__4__callbacks'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `send'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_validate_callbacks'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `send'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validations.rb:212:in `run_validations!'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validations/callbacks.rb:53:in `run_validations!'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:403:in `_run__920379347__validation__4__callbacks'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `send'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `send'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validations/callbacks.rb:53:in `run_validations!'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activemodel-3.2.0/lib/active_model/validations.rb:179:in `valid?'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/validations.rb:69:in `valid?'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/validations.rb:77:in `perform_validations'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/validations.rb:56:in `save!'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/transactions.rb:246:in `save!'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/transactions.rb:295:in `with_transaction_returning_status'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:190:in `transaction'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/transactions.rb:208:in `transaction'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.2.0/lib/active_record/transactions.rb:246:in `save!'
/home/roendal/beca/social_stream/base/lib/tasks/db/populate.rake:58:in `set_logos'
/home/roendal/beca/social_stream/base/lib/tasks/db/populate.rake:44:in `each'
/home/roendal/beca/social_stream/base/lib/tasks/db/populate.rake:44:in `set_logos'
/home/roendal/beca/social_stream/base/lib/tasks/db/populate.rake:252
/home/roendal/beca/social_stream/base/lib/tasks/db/populate.rake:252:in `each'
/home/roendal/beca/social_stream/base/lib/tasks/db/populate.rake:252
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/home/roendal/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/home/roendal/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/gems/rake-0.9.2.2/bin/rake:33
/home/roendal/.rvm/gems/ruby-1.8.7-p352/bin/rake:19:in `load'
/home/roendal/.rvm/gems/ruby-1.8.7-p352/bin/rake:19
Tasks: TOP => db:populate:reload => db:populate:create
```

Seems heavily related with avatars_for_rails and rails 3.2 compatibility (as is the only major change affecting this). The validation in avatar_for_rails
```ruby
validates_attachment_presence :logo, :if => :uploading_file?, :message => I18n.t('avatar.error.no_file')
```