Carrierwave undefined method `avatar_changed?' for User

carrierwave, ruby-on-rails-3, ruby-on-rails-3.2

Solution

If you use `mount_uploader: avatar, AvatarUploader` you should create database columns. IF you do not want to add columns, you should not mount an Uploader, but rather work with things like that:

uploader = AvatarUploader.new
uploader.store!(my_file)
uploader.retrieve_from_store!('my_file.png')

Problem

I use carrierwave gem for uploading image.I use attr_accessor: avatar in my model.I don't want to create the database column. I can store avatar in the particular directory.But when i update_attribute for some other field, i am getting undefined method `undefined method`avatar_changed?' for User`. Am i missing anything here? Help me to solve this. This is my User model ``` attr_accessor: avatar mount_uploader: avatar, AvatarUploader AvatarUploader < IconBase DIEMENSIONS=[120,120] def filename "avatar.png" end end ```

Original source