Undefined method for 'image_changed?'
I've looked at other solutions on the stack. I ran heroku run rake db:migrate
and heroku restart
and it didn't work.
def method_missing(method, *args, &block)
if respond_to_without_attributes?(method, true)
super
else
match = match_attribute_method?(method.to_s)
match ? attribute_missing(match, *args, &block) : super
end
end
# +attribute_missing+ is like +method_missing+, but for attributes. When
# +method_missing+ is called we check to see if there is a matching
I checked the AddImageToUsers migration file and everything seems to be in order.
class AddImageToUsers < ActiveRecord::Migration
def change
add_column :users, :image, :string
end
end
App\models\user.rb
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable
has_many :posts
mount_uploader :avatar, AvatarUploader
mount_uploader :image, ImageUploader
has_many :comments
def role?(base_role)
role == base_role.to_s
end
end
I'm not sure where to check the following
+3
source to share
No one has answered this question yet
Check out similar questions: