class Project
include Listable
listtable(data_attribute: :verified_at)
end
Concern
module Listable
class_methods do
def listable(data_attribute: :verified_at)
raise ActiveModel::MissingAttributeError,
"Must have a verified_at attribute" unless respond_to?(:verified_at)
end
end
end
In my
project model i am having column verified_at. if i am not having verified_at column in my table it should raise the error.
But here it is not responding properly. always raising the error(even the verified_at is present also)
Expected
Wherever i am including this concern in my model, it should check the verified_at column is present or not. If it is not present, should raise the error.
It is not happening for me, Please suggest me any solution, Thanks in advance