I am using rails_admin for admin panel. Just change association in Image model
From this
class Image < ApplicationRecord
belongs_to :user
belongs_to :product
end
to this
class Image < ApplicationRecord
has_one :user
has_one :product
end
and User model is
class User < ApplicationRecord
has_many :images,dependent: :destroy
end
Getting this error when I try to edit user from admin panel.From other side it is working fine.
ActiveRecord::StatementInvalid at /user/72/edit
PG::UndefinedColumn: ERROR: column users.image_id does not exist
LINE 1: SELECT "users".* FROM "users" WHERE "users"."image_id" = $1...
^
: SELECT "users".* FROM "users" WHERE "users"."image_id" = $1 LIMIT $2