Josh Kovach
Josh Kovach

Reputation: 7749

undefined method "has_attached_file" with paperclip

I'm getting some unexpected behavior from my app while Upgrading to from Rails 2.3.11 to 3.1, particularly in relation to Paperclip.

I've added the gem 'paperclip' to my Gemfile, and I ran bundle install and all seems to go well, except that when I start my server, I get this stack trace

...: `method_missing': undefined local variable or method `has_attached_file' for #<Class:0x7f30b32c1f88> (NameError)
...
...
from /home/user/railscamp/app/app/models/organization.rb:76
...
from /home/user/railscamp/app/config.ru:1:in `new'
from /home/user/railscamp/app/config.ru:1

Any thoughts?

Upvotes: 1

Views: 2316

Answers (1)

Eric
Eric

Reputation: 43

Add these to your model

attr_accessor :image_file_name, :image_content_type, :image_file_size, :image_updated_at

Upvotes: 1

Related Questions